Re: [Gimp-developer] re: color to alpha is slow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dov Kruger (dkruger@xxxxxxxxxxx) wrote:
> massive bandwidth reduction on our forecast website, see
> http://onr.dl.stevens-tech.edu/webnyhos3 for the original, and
> http://onr.dl.stevens-tech.edu/wwwnyhos1/index3.html for the
> experimental transparent version.

Sorry, these are two pages which have exactly the same image embedded.

> We currently execute a script-fu that turns all white pixels
> transparent, then turns the 24-bit-per-pixel image into indexed mode
> with 255 colors, setting color 0 transparent. It seems to take
[...]
> I suspect that color-to-alpha is the slow part. Is there anything we can
> do to speed this up, like convert the image to indexed, and just make
> color 0 transparent?

color-to-alpha indeed is computationally complex, because it not only
makes the color picked transparent, but also pushes as much transparency
as possible into all pixels, so that they appear the same as the
original, when the extracted color gets composed behind it.

And then you destroy this by indexing the image, where gimp no longer
supports partial transparency...  :-)

> Any help with code to programmatically make color
> entry n transparent would be great, we didn't find any reference to
> that.

Ok, I suspect that you'll save a lot of bandwidth by simply indexing the
image to e.g. 64 colors or so, the fiddeling with transparency probably
doesn't save you anything. And just indexing is probably way quicker by
using a standalone commandline tool.

However, if you want to make e.g. all white pixels transparent you could
index the image and then invoke gimp-by-color-select with appropriate
parameters, and then select edit->clear (make sure to add an alpha
channel if no one exists yet).

I hope this helps,
         Simon
-- 
              simon@xxxxxxxx              http://simon.budig.de/

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux