Upscale alpha channel separately from the PNG layer
Checklist
- I have checked that this issue isn't addressed in the FAQ.
- I have searched for this in the issues tab.
Description
When upscaling images that have a transparency layer, like PNG images, the actual image is upscaled, but the alpha channel is only stetched bilinearly, resulting in jagged pixelized edges where the edge of the transparency is.
There is a manual way to do this, by opening the PNG in photoshop, and going Layer>Layer Mask>From Transparency, then saving the color layer and the alpha layers separately, upscaling them (upscaling the alpha layer as a normal black-and-white image), then putting them back together in photoshop. However, this is very time consuming for something that should be done automatically by the program.
My proposal is for a check to occur before passing the image to the upscaling algorithm, that checks whether the image has an alpha channel, and if so, separates it as its own black-and-white image, upscales it on its own, then puts it back on the upscaled color image.
Original alpha channel:
Upscaled alpha channel as part of the image using current v.2.11.5 Upscayl (manual bilinear stretching gives the same result):
Upscaled alpha channel as its own black-and-white image:
Related Problem(s)
https://github.com/upscayl/upscayl/issues/556 - I don't know why this is closed, but it's the same issue, still unfixed.
Alternatives
The aforementioned manual method works, but is too slow and not for people who can't work with photoshop.
Source: upscayl/upscayl