Mobile app version of vmapp.org
Login or Join
Nimeshi706

: Why does resizing PNG with alpha transparency make edges gray? I'm using PSP 7 (I know it's old, but it serves my purposes). I am resizing a bunch of images. PNG images with alpha transparency

@Nimeshi706

Posted in: #CorelPaintShopPro #Png #Transparency

I'm using PSP 7 (I know it's old, but it serves my purposes).

I am resizing a bunch of images. PNG images with alpha transparency load with black backgrounds when I first open them. I have little experience with masks. I learned that I can do Masks > Load From Alpha Channel to see the transparent areas.

After loading the alpha channel, I resize the image. Usually, this works fine. However, sometimes the edges look a bit gray - kind of like if I made a transparent GIF on a gray background.

For the record, the box for Resize all layers is checked. If I uncheck that, the edges are black after resize. Also, the original images are already PNG-24 (16 million colors).

Here is the original viewed at 8x zoom (scaled in the browser to fit):



And here it is after reszing viewed at 8x zoom:



And here is the resized image viewed at 1x zoom:



It's probably not that noticeable to a lot of people, but the top edge does not look smooth to me.

Is there an easy way to fix this? Do I need to resize the mask separately?

The last one I had like this was a white circle. So I just cropped out the edges and added a white circle behind it. This one is a little harder.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Nimeshi706

3 Comments

Sorted by latest first Latest Oldest Best

 

@Samaraweera207

I think what Scott says in his comment is indeed what's happening.


A guess... the alpha channel and the image are being anti-aliased differently. The green is not masked by the alpha channel, but rather aligns with it. When you scale, the alignment is thrown off.


Here's how I fixed it.

1) Before loading the mask from the alpha channel, select the green area. Expand the selection (I expanded by 2 pixels). Here's the image at 4x zoom, showing the selection.



2) Using the same green color, flood fill the black area that's within the selection. Load mask from alpha channel and resize image. Here's the resized image at 8x zoom. Notice the lack of gray pixels.



Here is the final image at 1x zoom.



Here is the original for comparison.



The difference is subtle, but I think the new one is visibly smoother than the original.

10% popularity Vote Up Vote Down


 

@Kevin459

As Alex Blackwood pointed out in the comment above, it sounds as if your PNGs are using Index color. When ever you resize with this color mode, the colors get out of alignment and you get noise.

What you need to do before attempting to resize is go to Image > Mode > RGB Color

10% popularity Vote Up Vote Down


 

@Murphy569

There is a difference between how the transparency of the various PNG versions semi-transparent pixels are handled. If you resize and save the PNG to a different version than the original I guess it is possible that the semi transparent pixels were handled differently (ie matte) resulting in the difference you see. I'm not super conversant in any of this but if you are interested.

A Basic Explanation

If you want to dive into the geekiness there are a few really great items on SmashingMagazine's site that also touch on transparency.

There's a second part to this last one but I lack enough reputation to post additional links.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme