Problems with Transparency and image rendering
Posted: 2010-02-04T10:31:53-07:00
Hello Folks,
I'm having an intermittent problem with a perl/perlmagick script I'm using to process photos for a website.
The originals come in as .tif files in either RGB or CMYK mode, sized at 600x750.
My script (along with many other things) takes this image:
1. Resamples for density
2. rotates the image 5 degrees
3. sets the background (due to rotation) to white
4. Sets the size to 194x233
5. Saves the file to png format
6. Reopens the file
7. Sets the size to 225x256
8. Read(xc:white)
9. Sets Density again
10. Sets gravity center
11. Writes file again to png again
12. Reopens the file
13. Sets Alpha to on
14. Flood Fills transparency over the white background from the rotate
15. Writs the final image as a .gif
Here is what the final image SHOULD look like:
Here is the original:
Here is what happens sometimes (2 problems):
So, the first example is horrible, the second never gets the transparency added.
The puzzling thing is, I can (sometimes) re-run the image through the process and it works fine. In fact, if the image is bad, I grab the original and run it, and within a time or two, it works fine. This is not a consistent problem. Thoughts? Debugging I Can add to the script? I'll add the code part to the next post
I'm having an intermittent problem with a perl/perlmagick script I'm using to process photos for a website.
The originals come in as .tif files in either RGB or CMYK mode, sized at 600x750.
My script (along with many other things) takes this image:
1. Resamples for density
2. rotates the image 5 degrees
3. sets the background (due to rotation) to white
4. Sets the size to 194x233
5. Saves the file to png format
6. Reopens the file
7. Sets the size to 225x256
8. Read(xc:white)
9. Sets Density again
10. Sets gravity center
11. Writes file again to png again
12. Reopens the file
13. Sets Alpha to on
14. Flood Fills transparency over the white background from the rotate
15. Writs the final image as a .gif
Here is what the final image SHOULD look like:
Here is the original:
Here is what happens sometimes (2 problems):
So, the first example is horrible, the second never gets the transparency added.
The puzzling thing is, I can (sometimes) re-run the image through the process and it works fine. In fact, if the image is bad, I grab the original and run it, and within a time or two, it works fine. This is not a consistent problem. Thoughts? Debugging I Can add to the script? I'll add the code part to the next post