Add custom background to pngs

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

Moderators: helmut, XnTriq, xnview

Post Reply
JuanMi73
Posts: 2
Joined: Tue May 21, 2024 10:02 am

Add custom background to pngs

Post by JuanMi73 »

Hello.

Is it possible to create a batch process to add a custom background to multiple pngs?

Thanks!!

.
Attachments
duck.jpg
duck.jpg (21.49 KiB) Viewed 590 times
cday
XnThusiast
Posts: 4396
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Add custom background to pngs

Post by cday »

JuanMi73 wrote: Tue May 21, 2024 10:11 am Is it possible to create a batch process to add a custom background to multiple pngs?
I think not: it would be possible if the Batch convert 'Watermark' function had an option to use loaded input files as the 'watermark' on a selected fixed background, rather than applying a fixed watermark to all loaded input files.

This situation arises occasionally, and I think the possibility of including such an option was discussed once, so if it might be worth making a suggestion to add one. Edit: I have made a suggestion: Batch convert 'Watermark option' - Add option to apply loaded images to a fixed background.

This should, however, be possible using an NConvert script that applies each loaded input file as a 'watermark' to a fixed custom background.
cday
XnThusiast
Posts: 4396
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Add custom background to pngs

Post by cday »

@JuanMi73: See my edit above, I have made the suggestion.
JuanMi73
Posts: 2
Joined: Tue May 21, 2024 10:02 am

Re: Add custom background to pngs

Post by JuanMi73 »

cday wrote: Tue May 21, 2024 11:07 am @JuanMi73: See my edit above, I have made the suggestion.
Thanks cday :)


Edit: I have been able to do it with nconvert and batch file.
All my images in png to webp adding a "background.webp"
Thanks again!!

Code: Select all

@echo off
cd %~dp0
for %%x in (*.png) do (
  nconvert -quiet -overwrite -wmopacity 100 -wmflag center -wmfile "%%x" -out webp -q 80 -o "%%~nx.webp" background.webp
)
Post Reply