Page 1 of 1

transparency question - large files

Posted: 2008-06-20T11:00:19-07:00
by russellbarnhart
im trying to convert an image that has a transparent background:
Image
http://www.itsalmostreal.com/test.png

and replacing the background with solid white like:
Image
http://www.itsalmostreal.com/done.png


i'll be operating on huge files (44inches x 80inches @ 300 dpi) so im trying to do this using a method other than the following ones, because they forever on large files:

Code: Select all

 convert test.png -flatten done.png 

Code: Select all

 convert -size 1500x1500 xc:white test.png -geometry +0+0 -composite done.png 
whenever i try to kill the transparency, using either of the two following examples, the area that was transparent becomes black.

Code: Select all

convert test.png -alpha off done.png

Code: Select all

convert test.png -alpha reset done.png
i also already tried this, but for some reason it doesnt work either

Code: Select all

convert test.png -transparent-color white -alpha off done.png

in short i need a quick way to make sure that all apps see the background as being white, and not black. the input image (test.png) is a product of converting a layered PSD to flat TIFF conversion using Apple's SIPS. i ran into problems loading large layered psd files (anyone know how to load the composite image in PSDs?), so i had to use something to convert them to a format i can use with IM (flat TIFF files).

i guess the quyestion im asking is... is there a way to remove set all transparent space to the color white without actually processing each pixel? can the image header be modified to do the deed?

thanks for any help!

im using -> ImageMagick 6.3.7 02/19/08 Q16 on Ubuntu Server 8.04

Re: transparency question - large files

Posted: 2008-06-20T11:42:49-07:00
by magick
Composite your image on a white background:
  • convert -size 300x300 xc:white test.png -compose over -composite new.png
If the command fails, you may need to update your version of ImageMagick.

Re: transparency question - large files

Posted: 2008-06-20T12:12:52-07:00
by russellbarnhart
can the image header be modified to do this instead of processing the pixel data?

i want to change
Alpha: none #00000000
to
Alpha: rgba(255,255,255,1) #FFFFFF00

can i do that without having to load ALL the image data?

Re: transparency question - large files

Posted: 2008-06-20T13:28:00-07:00
by fmw42
try

convert test.png -channel RGBA -fill white -opaque none done.png

or

if not solid white background then

convert test.png -channel RGBA -fuzz 5% -fill white -opaque none done.png

play with the 5% value until you get what you want.