How to convert transparent backgrounds to black color backgrounds?

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, helmut, xnview

xinni
Posts: 10
Joined: Sat May 04, 2024 1:16 pm

How to convert transparent backgrounds to black color backgrounds?

Post by xinni »

Hello my helping friends :-)

I'm trying to batch convert some pngs with transparent background to jpeg format with black background color, but XNViewMP only converts them to white background files.

I only found this posting, which is from 2018, telling me, there might be an option to select the background color, but I don't know all the terminology to find that specific option.

I asked chat-gpt too, but after 20 minutes of hallucinating answers, I did not had a solution. :-(

I think this must be too simple so I cannot find it...
User avatar
user0
XnThusiast
Posts: 2121
Joined: Sat May 09, 2015 9:37 am

Re: How to convert transparent backgrounds to black color backgrounds?

Post by user0 »

if you convert:
- 32bit image - run as is
- indexed - also enable "Transparent color" action (any color/any tolerance, no idea why :D )

batch_convert_to_24bit.png

related
General - canvas background color - improve consistency of use
You do not have the required permissions to view the files attached to this post.
Last edited by user0 on Wed Oct 30, 2024 7:53 am, edited 1 time in total.
cday
XnThusiast
Posts: 4238
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: How to convert transparent backgrounds to black color backgrounds?

Post by cday »

xinni wrote: Mon Sep 23, 2024 9:08 am I'm trying to batch convert some pngs with transparent background to JPEG format with black background color...
... then set Output tab format to JPEG with your desired saving settings.
xinni
Posts: 10
Joined: Sat May 04, 2024 1:16 pm

Re: How to convert transparent backgrounds to black color backgrounds?

Post by xinni »

cday wrote: Mon Sep 23, 2024 12:14 pm
xinni wrote: Mon Sep 23, 2024 9:08 am I'm trying to batch convert some pngs with transparent background to JPEG format with black background color...
... then set Output tab format to JPEG with your desired saving settings.
Out of curiosity and because your solution reads so easy, where would I do that?

This is what I see:
Batch convert.png
You do not have the required permissions to view the files attached to this post.
xinni
Posts: 10
Joined: Sat May 04, 2024 1:16 pm

Re: How to convert transparent backgrounds to black color backgrounds?

Post by xinni »

user0 wrote: Mon Sep 23, 2024 10:07 am if you convert:
- 32bit image - run as is
- indexed - also enable "Transparent color" action (any color/any tolerance, no idea why :D )
Thank you,
"run as is" did not work, or I can't figure out what you mean by that.

The only way, I could get it to work (for 32Bit images) is this:
32bit_works.png
That seems odd to me, when I read both of your "easy" ways to do it.
You do not have the required permissions to view the files attached to this post.