Page 1 of 1

Backgrounds when removing alpha channel

Posted: Sat Dec 19, 2015 3:53 pm
by mtg45
When you convert PNG with alpha channel to JPG without it, the final JPG has fragments that would otherwise be hidden by the alpha channel.

I'd like to ask for an action, or setting to configure backgrounds for images that originally had alpha channel.

Or, tell me how to do that in the current 1.71, in a case I missed it somehow :)

Re: Backgrounds when removing alpha channel

Posted: Sat Dec 19, 2015 10:45 pm
by XnTriq
Welcome to the forum, mtg45 (-:

Adding an extra action to change the color depth to truecolor before converting 32-bit PNGs to JPEG should do the trick.

Re: Backgrounds when removing alpha channel

Posted: Sun Dec 20, 2015 10:39 am
by mtg45
Hm.., yes, the artifacts are now gone, but it doesn't allow me to change the background. It'll always be white.

But, good enough for most of the cases I guess. Thank you :)

Edit: I have to add though that this is in no way intuitive, and unless told I wouldn't be able to figure this out. Specific action that handles background behavior for alpha channel removal would be amazing.

Re: Backgrounds when removing alpha channel

Posted: Mon Dec 21, 2015 4:30 am
by XnTriq
IMO, this feature should be added to all versions of XnView (including XnConvert and NConvert).
XnTriq ([url=http://newsgroup.xnview.com/viewtopic.php?p=55999#p55999]Loading GIF, removing transparency, saving JPG[/url]) wrote:
xnview ([url=http://newsgroup.xnview.com/viewtopic.php?p=31842#31842]Convert PNG -> JPG, transaprency is black[/url]) wrote:
Gordon wrote:I am trying to convert PNGs with transparency to JPG, but the transparency is always black. I woudl like ti to be white. I have tried the -transpcolor option but I didn't do anything.

If it possible to set the transparency color converting to JPG?
Is this syntax correct?

... -out jpeg -transpcolor 255 255 255 -keepcspace -q 100 ...
You can't change the transparency color when saving in jpeg

Re: Backgrounds when removing alpha channel

Posted: Mon Aug 22, 2016 9:11 am
by Danny
Bump.

It would be really helpful to somehow be able to select which color the transparency will have, if the output format doesn't support transparency (JPG, ...). Otherwise, you'd have to do it in two passes (first convert to lossless format without transparency, then convert to JPG by replacing BG color), which sucks.

It could even be a program-wide setting like the preview background color.