RSS/Atom feed Twitter
Site is read-only, email is disabled

how to preserve semi-transparency when converting to indexed

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

10 of 11 messages available
Toggle history

Please log in to manage your subscriptions.

how to preserve semi-transparency when converting to indexed j_mach_wust j_mach_wust 04 Aug 16:05
  how to preserve semi-transparency when converting to indexed Matthias Julius 04 Aug 23:51
   how to preserve semi-transparency when converting to indexed Alan Horkan 05 Aug 14:55
  how to preserve semi-transparency when converting to indexed saulgoode@brickfilms.com 04 Aug 23:59
  how to preserve semi-transparency when converting to indexed temp-user 02 Jul 00:49
   how to preserve semi-transparency when converting to indexed Michael Schumacher 02 Jul 19:43
how to preserve semi-transparency when converting to indexed j_mach_wust j_mach_wust 05 Aug 14:09
  how to preserve semi-transparency when converting to indexed saulgoode@brickfilms.com 05 Aug 15:13
CE4BA44743C6B846BE46B70529C... 07 Oct 20:17
  how to preserve semi-transparency when converting to indexed j_mach_wust j_mach_wust 05 Aug 11:00
   how to preserve semi-transparency when converting to indexed saulgoode@brickfilms.com 05 Aug 12:00
j_mach_wust j_mach_wust
2006-08-04 16:05:27 UTC (over 17 years ago)

how to preserve semi-transparency when converting to indexed

Hi

When I created png images of black text on transparent background, I used to convert them to indexed so their size would be reduced. Since I installed a new version, the semi-transparency is cut off and I have just plain black on transparent background as if there were no antialiasing, very ugly.

I faintly remember that I had this same problem before. I have no idea what I did to solve it. I just did, and it worked all right, so I forgot about the problem.

I'd very much appreciate your help. mach


---------------------------------
Yahoo! Music Unlimited - Access over 1 million songs.Try it free.

Matthias Julius
2006-08-04 23:51:31 UTC (over 17 years ago)

how to preserve semi-transparency when converting to indexed

j_mach_wust j_mach_wust writes:

When I created png images of black text on transparent background, I used to convert them to indexed so their size would be reduced.

How much does this reduce the file size?

Matthias

saulgoode@brickfilms.com
2006-08-04 23:59:15 UTC (over 17 years ago)

how to preserve semi-transparency when converting to indexed

Since I installed a new version, the semi-transparency is cut off and I have just plain black on transparent background as if there were no antialiasing, very ugly.

I wrote a script a while back that attempted to address this (available at
http://flashingtwelve.brickfilms.com/GIMP/Scripts/de-alias.scm). It works by replacing the non-transparent portion of each layer with the result of merging the layer with the layers below (actually the "projection" of the layers below it).

The image at http://flashingtwelve.brickfilms.com/GIMP/Temp/de-alias.png might help explain the result. An opaque background is expected and that gets "hard-coded" into all non-transparent portions of the GIF. Fully transparent regions remain transparent (but I doubt if this fact would be of much use other than keeping filesize down).

I got it working only to the extent that I needed it, so there may be some bugs in it of which I am unaware. If you let me know whether the script needs modification, I might revisit it.

j_mach_wust j_mach_wust
2006-08-05 11:00:43 UTC (over 17 years ago)

how to preserve semi-transparency when converting to indexed

saulgoode wrote:

Since I installed a new version, the semi-transparency is cut off and I have just plain black on transparent background as if there were

no

antialiasing, very ugly.

I wrote a script a while back that attempted to address this (available at

http://flashingtwelve.brickfilms.com/GIMP/Scripts/de-alias.scm).

It works by replacing the non-transparent portion of each layer with the result of merging the layer with the layers below (actually the "projection" of the layers below it).

That sounds as if it's still impossible to preserve semi-transparency while converting to indexed in the GIMP. Therefore, my claim that I had been able to do exactly that must be really weird. That's strange, I very vividly remember doing exactly that until yesterday. Memory can fail, maybe I'm wrong.

-----

Matthias Julius wrote:

j_mach_wust j_mach_wust writes:

When I created png images of black text on transparent background, I used to convert them to indexed so their size would be reduced.

How much does this reduce the file size?

I don't remember exactly, but I thought I tried it and it significantly reduced the file size, so therefore I kept doing it.

I'm confused now.

---

grüess mach

___

saulgoode@brickfilms.com
2006-08-05 12:00:09 UTC (over 17 years ago)

how to preserve semi-transparency when converting to indexed

Quoting j_mach_wust j_mach_wust :

saulgoode wrote:

It works by replacing the non-transparent portion of each layer with the result of merging the layer with the layers below (actually the "projection" of the layers below it).

That sounds as if it's still impossible to preserve semi-transparency while converting to indexed in the GIMP.

It is impossible to preserve semi-transparency for GIF files in general; the format does not permit it. The GIF file specification permits ONE color to be treated as a "skip this pixel entirely", there is no allowance for any partially transparent pixels. This has nothing to do with the GIMP, it is a limitation of the file format.

Matthias Julius wrote:

How much does this reduce the file size?

I don't remember exactly, but I thought I tried it and it significantly reduced the file size, so therefore I kept doing it.

I'm confused now.

The PNG file format specification permits a similar indexed encoding scheme as the GIF format; thus a PNG file should, at a minimum, be able to replicate the GIF file's compression ratio. Some image programs (Photoshop, for example) *used to* inefficiently convert indexed images to 24-bit RGB PNGs which resulted in dramatic increases in file size. This was done at a time when those programs did not fully support the PNG specification, I very much doubt that any software suffers from this lapse anymore (well, maybe some of Microsoft's offerings).

j_mach_wust j_mach_wust
2006-08-05 14:09:32 UTC (over 17 years ago)

how to preserve semi-transparency when converting to indexed

saulgoode wrote:

The PNG file format specification permits a similar indexed encoding scheme as the GIF format;

Unlike an indexed GIF, an indexed PNG allows semi-transparency. I thought I was able to produce such semi-transparent indexed PNG with GIMP. I don't know how I did it.

It appears that former versions of GIMP were not able to produce semi-transparent indexed files at all (to be saved as PNG). My question is: Is it now possible to have semi-transparent indexed files (I thought it were as I can remember I did it)? If it is possible, then how to do it?

---

grüess mach

___

Alan Horkan
2006-08-05 14:55:53 UTC (over 17 years ago)

how to preserve semi-transparency when converting to indexed

On Fri, 4 Aug 2006, Matthias Julius wrote:

Date: Fri, 04 Aug 2006 17:51:31 -0400 From: Matthias Julius
To: j_mach_wust j_mach_wust
Cc: gimp-user@lists.XCF.Berkeley.EDU Subject: Re: [Gimp-user] how to preserve semi-transparency when converting to indexed

j_mach_wust j_mach_wust writes:

When I created png images of black text on transparent background, I used to convert them to indexed so their size would be reduced.

How much does this reduce the file size?

I cannot say specifically how much converting to indexed will save you but when using PNG files it means you will end up with an 8bit PNG instead of a 24bit PNG which is where most of the savings seem to come from.

saulgoode@brickfilms.com
2006-08-05 15:13:52 UTC (over 17 years ago)

how to preserve semi-transparency when converting to indexed

Quoting j_mach_wust j_mach_wust :

saulgoode wrote:

The PNG file format specification permits a similar indexed encoding scheme as the GIF format;

Unlike an indexed GIF, an indexed PNG allows semi-transparency. I thought I was able to produce such semi-transparent indexed PNG with GIMP. I don't know how I did it.

It appears that former versions of GIMP were not able to produce semi-transparent indexed files at all (to be saved as PNG). My question is: Is it now possible to have semi-transparent indexed files (I thought it were as I can remember I did it)? If it is possible, then how to do it?

I misunderstood what you were asking before, sorry.

My understanding of the PNG indexed format is each color of the palette can have a different transparency level assigned to it. If this is true, there should be a way to duplicate the colors of your palette with varying levels of opacity. For a B&W palette, you could have 128 levels of opacity for each, for a 4-color palette, 64 levels, etc.

I am unaware of the GIMP possessing such a capability but that is not to say it doesn't exist. :)

2012-07-02 00:49:21 UTC (almost 12 years ago)
postings
1

how to preserve semi-transparency when converting to indexed

I used to convert them to indexed so their size would be reduced. Since I installed a new version, the semi-transparency is cut off and I have just plain black on transparent background as if there were no antialiasing, very ugly.

I too used to use the ability to create indexed color pngs with semi-ransparent pixels. this ability seems to have been either removed, lost or broken in the more recent release of gimp.

the png format can support it but it looks like gimp just does indexed color conversion in a very GIF-like way.

Michael Schumacher
2012-07-02 19:43:11 UTC (almost 12 years ago)

how to preserve semi-transparency when converting to indexed

On 02.07.2012 02:49, temp-user wrote:

I used to convert them to indexed so their size would be reduced. Since I installed a new version, the semi-transparency is cut off and I have just plain black on transparent background as if there were no antialiasing, very ugly.

I too used to use the ability to create indexed color pngs with semi-ransparent pixels. this ability seems to have been either removed, lost or broken in the more recent release of gimp.

the png format can support it but it looks like gimp just does indexed color conversion in a very GIF-like way.

GIMP has no support for this - there's an ancient bug report about allowing real alpha channels in indexed files, see https://bugzilla.gnome.org/show_bug.cgi?id=86627

The PNG plug-in should load the alpha channel from an indexed PNG file, but you'll have to et the mode to RGB in order to make use of it.

HTH, Michael