Page 2 of 2
Re: Png getting corrupted
Posted: 2010-12-03T17:09:07-07:00
by gegupta
GreenKoopa wrote:Again, I don't believe that there is any fault/bug. That 'corruption' is in the original image. You moved to a format with no alpha support without instructing ImageMagick how you wanted that handled.
Having an alpha channel gives an image the ability to do transparency. If an image has every pixel at 255 (no transparency), then the image is simply not using that ability,
This makes sense.
GreenKoopa wrote:Do you need something different, or are you simply curious to understand?
I was investigating an issue and things were not making sense. So I was mostly curious.
fmw42,
This happens with IE 6.2.8 as well as i mentioned earlier. Resize again keeps the image in same format which supports Alpha transperancy and hence doesnt affect. What in your view should ideally happen if you dont turn off Alpha and resize it?
Thanks
Re: Png getting corrupted
Posted: 2010-12-03T17:19:32-07:00
by GreenKoopa
fmw42 wrote:
However, when I resize the Panasonic-RP-HS200-K-Black-vfr-detail.png it looks fine with the alpha channel, but when I turn off the alpha channel that odd part of the background turns black.
So something odd is happening, but I am not sure just yet what. As I said there have been some changes to PNG processing and this could be a side effect. Hopefully glennrp can look at this.
fmw42 wrote:
The input image is what it is. Turning off the alpha channel leave behind what is there. However, I am concerned that when resizing by 50%, the output looks fine until you turn off the alpha channel. Then all the funny striped area, i.e. everything under the transparent areas turn black. I don't think that should happen. This is happening with IM 6.6.6.2 Q16 (hdri) Mac OSX Tiger
Great catch! Having explained one issue and created the output I was looking for, I totally missed your point. I never even attempted a -resize. Oops. Apparently we could all be more through readers.
Now I am seeing the blackness you describe. I tried Windows versions 6.6.6-3/2 (2010-12-01) and 6.6.5-8 (2010-11-10).
Re: Png getting corrupted
Posted: 2010-12-03T19:32:07-07:00
by fmw42
fmw42,
This happens with IE 6.2.8 as well as i mentioned earlier. Resize again keeps the image in same format which supports Alpha transperancy and hence doesnt affect. What in your view should ideally happen if you dont turn off Alpha and resize it?
Well, as far as I can tell, the result of the resize is fine
if you don't turn off transparency. The image is just 50% smaller in width and height, but it looks the same to me. I don't see any problem with the current IM version. I am not sure what problem you are concerned about. But it is possible that with such an old version of IM, you are not getting the best results or perhaps a bug at that time.
The only issue I see is that when resized and the transparency is turned off, then the area where there was transparency turns black; whereas before the resize, it had a funny striped pattern, which I believe is actually in your image and not an IM issue.
Can you explain further what issue you are seeing with the original image and with the resized image
before and after you turn off transparency?
Here is what I have before and after resize (IM 6.6.6.2 Q16 (hdri) Mac OSX Tiger):
original:
original alpha off:
original resized 50%:
original resized50% alpha off:
Re: Png getting corrupted
Posted: 2010-12-04T08:10:26-07:00
by glennrp
I believe this is fixed in SVN head, to be in 6.6.6-3 soon. Look for 6.6.6-3 beta created later than 3 December. I think the problem only existed in the Q16 build.
Re: Png getting corrupted
Posted: 2010-12-04T10:35:43-07:00
by fmw42
Thanks Glenn, I will look for the update when available and report back.
Fred
Re: Png getting corrupted
Posted: 2010-12-04T17:53:06-07:00
by fmw42
Glenn,
I am still getting the same result as above (black under transparent area) when doing:
convert Panasonic-RP-HS200-K-Black-vfr-detail.png -resize 50% -alpha off Panasonic-RP-HS200-K-Black-vfr-detail_test.png
IM 6.6.6.3 Q16 (hdri) Mac OSX Tiger
Fred
Re: Png getting corrupted
Posted: 2010-12-05T18:41:27-07:00
by anthony
Transparency and the three most common file formats...
First saving to JPEG... You wnt to replace transparency with some specific color.
See IM examples Basics, Removing Alpha Channel
See
http://www.imagemagick.org/Usage/basics/#alpha_remove
The second is if you actually want to make your PNG smaller by setting what the
fully-transparent color is in the PNG image (so it compresses better)
IM examples Basics, Set Alpha Background Color
http://www.imagemagick.org/Usage/basics ... background
And just to complete this trifecta for GIF images you can specify what color should be used for its representation of transparency in the color pallete (it can be a duplicate of an existing color)
See IM examples, Common File Formats, GIF Transparency Color
http://www.imagemagick.org/Usage/formats/#gif_trans