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

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

 



Hello fellow gimpers,

Apologies if this is not the correct group, but the users email seems
geared towards people who use menus, not code.

We are using gimp to batch process 3000 or so images per day
generated from an oceanographic forecasting system. We need to make the
background color of a 24bit png image transparent, and turn it into an 8
bit image because Internet Explorer can't handle alpha transparency
evidently, more reason to use Mozilla. You might ask, why are we doing
this? Answer: by pulling static background out of our maps, we achieve a
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.

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
approximately 1 second per image, and the images are not all that big
(some are as little as 15k, though the bigger maps, like Long Island,
are as big as 150k). We do 100 at a time in a script, because the
command line literally gets too long after a while -- we could probably
increase that number to 500 or even decrease it, but the dominant factor
seems to be the time it takes to do these operations. The machine is a
2.6Ghz P4 with 2Gb of RAM, the raw CPU should be capable of a lot more
than this, and I allocated 500M in the gimp configuration, could some
garbage collection problem be an issue?

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? Any help with code to programmatically make color
entry n transparent would be great, we didn't find any reference to
that.

Oh, and to everyone who works on gimp, you guys kick serious butt! What
a tool!

thanks,
Dov


[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