Backgrounds when removing alpha channel

XnConvert Multi Platform - Windows, MacOSX, Linux
mtg45
Posts: 3
Joined: Sat Dec 19, 2015 3:46 pm

Backgrounds when removing alpha channel

Postby mtg45 » Sat Dec 19, 2015 3:53 pm

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 :)

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

Re: Backgrounds when removing alpha channel

Postby XnTriq » Sat Dec 19, 2015 10:45 pm

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.

mtg45
Posts: 3
Joined: Sat Dec 19, 2015 3:46 pm

Re: Backgrounds when removing alpha channel

Postby mtg45 » Sun Dec 20, 2015 10:39 am

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.

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

Re: Backgrounds when removing alpha channel

Postby XnTriq » Mon Dec 21, 2015 4:30 am

IMO, this feature should be added to all versions of XnView (including XnConvert and NConvert).

XnTriq (Loading GIF, removing transparency, saving JPG) wrote:
xnview (Convert PNG -> JPG, transaprency is black) 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


Danny
Posts: 549
Joined: Sat Sep 04, 2004 5:09 pm

Re: Backgrounds when removing alpha channel

Postby Danny » Mon Aug 22, 2016 9:11 am

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.
Get the bugs fixed, THEN start adding features. It sucks, but someone has to do it.


Return to “XnConvert”

Who is online

Users browsing this forum: No registered users and 3 guests