Set Background Color for PNG

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

armin
Posts: 1
Joined: Mon Apr 19, 2004 8:54 am

Set Background Color for PNG

Post by armin »

Hi,

i have a png icon collection and want to create disabled and selected icons. I managed to create disabled icons with

nconvert -grey 256 -transparent 0 -o %_disabled.png $*

but I found no way to set the background to a specified value to create a selected icon:

nconvert -canvas 100% 100% -bgcolor 0 0 255 -o %_selected.png

did not work as expected.

It would be nice to have a way to create rollover and pressed icons also, but thats not really important.

Thanx

Armin
User avatar
xnview
Author of XnView
Posts: 44616
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Set Background Color for PNG

Post by xnview »

armin wrote:i have a png icon collection and want to create disabled and selected icons. I managed to create disabled icons with

nconvert -grey 256 -transparent 0 -o %_disabled.png $*

but I found no way to set the background to a specified value to create a selected icon:

nconvert -canvas 100% 100% -bgcolor 0 0 255 -o %_selected.png

did not work as expected.
-bgcolor is used to specify background color for rotate/canvas resize/...
You can use -transparent or -transpcolor.
Pierre.