Reducing Halo Effect in Rescaled/Resized Images

XnConvert Multi Platform - Windows, MacOSX, Linux

Moderators: XnTriq, helmut, xnview

Missletoss
Posts: 8
Joined: Sat Jan 11, 2014 5:53 am

Reducing Halo Effect in Rescaled/Resized Images

Post by Missletoss »

Hi, I was wondering if there was a way to minimize or prevent halo effect from happening?

When I reduce .pngs to a smaller size (approximately 1/3 of the original size) I get a greyish, jagged halo effect around some of the more jagged areas of the image. This happens for all the algorithms (I've tried Bilinear, Hanning, and everything in between.) The .pngs, incidentally are images with transparent backgrounds.

The only algorithm that doesn't produce the halo is "Nearest Neighbor", but the image loses too much quality in that instance.

Any suggestions would be appreciated. I don't know if changing any of the settings would help, but I certainly don't know enough about all the terminology or concepts to figure out which setting to change.

Thank you!
User avatar
XnTriq
Moderator & Librarian
Posts: 6387
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by XnTriq »

Could you post a sample, Missletoss?
Missletoss
Posts: 8
Joined: Sat Jan 11, 2014 5:53 am

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by Missletoss »

Sure, thank you for the quick reply.

It's a bit hard to see, but these are a .png series of facial parts that will be layered over other images. (look towards the center of the .pngs)

I reduced mouth1.png to mouth 2.png using Lanczos (and all the others had a similar result...the gray stuff around the edge of the small peach area.)
mouth1.png
mouth2.png
Any advice appreciated, thank you again!
You do not have the required permissions to view the files attached to this post.
Missletoss
Posts: 8
Joined: Sat Jan 11, 2014 5:53 am

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by Missletoss »

And yes, it was a reduction in size. It might seem like I enlarged the .png but I think the forum automatically blows up the .pngs to whatever size fits the post.
User avatar
XnTriq
Moderator & Librarian
Posts: 6387
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by XnTriq »

This problem is not unique to XnView/XnConvert. I'll try to find a workaround.

BTW: Do you use the lastest version (1.60) of XnConvert?
Missletoss
Posts: 8
Joined: Sat Jan 11, 2014 5:53 am

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by Missletoss »

Yes, I use 1.60.

Thank you for the links!

Right now I'll use "replace" color which sort of changes the image but at least gets rid of some of the grey.

I'd probably just hand paint the smaller .pngs, but I have over a hundred images like this that need to be resized.

Thank you again! I appreciate your help.
User avatar
XnTriq
Moderator & Librarian
Posts: 6387
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by XnTriq »

Missletoss wrote:I'd probably just hand paint the smaller .pngs, but I have over a hundred images like this that need to be resized.
If you have Photoshop, the well-documented actions provided by Robin Wood will save you a lot of work.
Missletoss
Posts: 8
Joined: Sat Jan 11, 2014 5:53 am

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by Missletoss »

Thanks! I may have to do that at some point if I can't find another work around. I'm using SAI unfortunately.
User avatar
XnTriq
Moderator & Librarian
Posts: 6387
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by XnTriq »

Missletoss wrote:And yes, it was a reduction in size.
Did you resize by pixels or percentage?
  • Input: mouth1.png (2000×3000 px)
  • Output: mouth2.png (526×790 px)
Missletoss wrote:I'm using SAI unfortunately.
Systemax PaintTool SAI?
png-halo-remove wrote:Command line tool / API to remove the "White Halo" Artifact on Transparent PNGs saved by programs such as Adobe Photoshop. (White are halos noticeable when an image is resized with linear filtering, this program will smear the border color out on fully transparent-pixels)
Currently only works on 32-bit (RGBA) PNG files
Sorry I couldn't be any more help :-|
We really need a solution. Even the official icon for XnView Classic has this effect:
  • Image
How about extracting the alpha channel and resizing it separately?
Missletoss
Posts: 8
Joined: Sat Jan 11, 2014 5:53 am

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by Missletoss »

Did you resize by pixels or percentage?

Input: mouth1.png (2000×3000 px)
Output: mouth2.png (526×790 px)
By pixels.
Systemax PaintTool SAI?
Yes, that's what I'm using.

Sorry I couldn't be any more help :-|
We really need a solution. Even the official icon for XnView Classic has this effect:
I really appreciate all the replies so far! I'm amazed this board is so helpful and quick in its replies, much more so than boards for commercial software!
How about extracting the alpha channel and resizing it separately?
I'll try that, but not sure what I do with it after that to get it transparent again?
Missletoss
Posts: 8
Joined: Sat Jan 11, 2014 5:53 am

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by Missletoss »

Just an FYI:
After fiddling with various options, I followed one of your links to ImageMagick above, which seems to be the only program that somehow seems to have fixed the halo resizing problem internally (not sure how).

I love xnconvert though and I don't like using the command prompt, so I'm hoping to return to xnconvert at some point! It works amazingly well for everything else. :)
User avatar
XnTriq
Moderator & Librarian
Posts: 6387
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by XnTriq »

Hi again (-:
Missletoss wrote:
XnTriq wrote:Did you resize by pixels or percentage?
  • Input: mouth1.png (2000×3000 px)
  • Output: mouth2.png (526×790 px)
By pixels.
Can you confirm that the Keep ratio checkbox for the Resize action has no effect in v1.60 of XnConvert for Windows?
Missletoss wrote:
XnTriq wrote:How about extracting the alpha channel and resizing it separately?
I'll try that, but not sure what I do with it after that to get it transparent again?
XnConvert lets you extract the RGBA channels of 32-bit PNGs. As it turns out, only NConvert (the command-line version) can load/merge an alpha channel mask.

We'll have to wait & see what Pierre (the developer of everything Xn) says. In the meantime, I've done a few tests with the sample you've provided:
  • Image Adobe Photoshop v6.0.1 (Bicubic) + fnord SuperPNG v1.1
    Image Corel Photo-Paint v11.633 SP2
    Image Greenfish Icon Editor Pro v3.31
    Image Human Balance GraphicsGale v1.93
    Image Jasc Paint Shop Pro v9.01 (Smart)
    Image Macromedia Fireworks v4.0.2 (Bicubic)
    Image PhotoFiltre v7.1.2 (Lanczos)
    Image Sib Icon Editor v4.00 (Lanczos3)
    Image ThumbsPlus v7.0 SP2 build 2251
    Image XnView v2.13 (Lanczos)
You do not have the required permissions to view the files attached to this post.
Missletoss
Posts: 8
Joined: Sat Jan 11, 2014 5:53 am

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by Missletoss »

The Keep Ratio button does work. When I click it, it the image will stretch or not accordingly. Is that what you mean?

Wow! The test results are really interesting. It seems like there is a very wide range in terms of what programs will do.
User avatar
XnTriq
Moderator & Librarian
Posts: 6387
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by XnTriq »

Missletoss wrote:The Keep Ratio button does work. When I click it, it the image will stretch or not accordingly. Is that what you mean?
Yes, that's what I'm talking about. Thanks for checking. When Keep ratio is activated and I change the value for Width, the Height stays the same.
Missletoss wrote:Wow! The test results are really interesting. It seems like there is a very wide range in terms of what programs will do.
Right, especially in those cases where the same algorithm is used :?
User avatar
XnTriq
Moderator & Librarian
Posts: 6387
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Reducing Halo Effect in Rescaled/Resized Images

Post by XnTriq »

Top to bottom:
  1. Adobe Photoshop v6.0.1 (Bicubic) + fnord SuperPNG v1.1
  2. Corel Photo-Paint v11.633 SP2
  3. Greenfish Icon Editor Pro v3.31
  4. Human Balance GraphicsGale v1.93
  5. Jasc Paint Shop Pro v9.01 (Smart)
  6. Macromedia Fireworks v4.0.2 (Bicubic)
  7. PhotoFiltre v7.1.2 (Lanczos)
  8. Sib Icon Editor v4.00 (Lanczos3)
  9. ThumbsPlus v7.0 SP2 build 2251
  10. XnView v2.13 (Lanczos)
Left to right:
  1. View » Show Mask
  2. View » Use alpha channel on
  3. View » Use alpha channel off
You do not have the required permissions to view the files attached to this post.