How do I save a png with transparent background
Moderators: helmut, XnTriq, xnview
How do I save a png with transparent background
I'm new to XnView and can't get my pngs to substitute my white background with a transparency. The background remains white. In the png options I set transparency to palette entry 0 (whatever that means). Can someone tell me what I'm doing wrong? Thanks.
Colours count


• It depends on which colour-depth you image is.
- With a 32-BPP image, tick the menu-item “View” >> Use alpha channel
- With a 4…8 BPP image (256 colours max.) you can use the menu-item “Image” >> Edit Colormap,
then set the transparent colour according to the dominant one of the background (here, white, IIUC) in the dialogue.
- Save the file when done…
- This entry is also in the “View” menu now. I confess that I never understood that it means really……In the png options I set transparency to palette entry 0 (whatever that means). …


Claude
Clo
Old user ON SELECTIVE STRIKE till further notice •
Thank you for your prompt reply Clo. I'm using version 1.91.6 and cannot find the alpha channel setting under the View menu. The only place I see to set png transparency settings is under Tools->options, which allows for the following:
PNG Read
Compose image with transparency (checked)
compose image with alpha (32bits) (checked)
Write
Set transparency value to palette entry 0 (checked)
Still, none of those entries set my white background to transparent.
PNG Read
Compose image with transparency (checked)
compose image with alpha (32bits) (checked)
Write
Set transparency value to palette entry 0 (checked)
Still, none of those entries set my white background to transparent.
View mode


• These menu items are in the main window (“View” mode), not in the browser :

• Same for the Colormap item in the Image menu, it's also in “View” mode…
- That works here, maybe could you show a small sample ?
- Please, check too in the Option whether the chequered pattern as transparency is ticked or not :
Options >> View…
- Your images must be either 32 BPP or 8 BPP (and less), it seems that 24 BPP ones can't get the transparency
(neither colormap, nor Alpha channel…)

Claude
Clo
Old user ON SELECTIVE STRIKE till further notice •
Computer Desktop Encyclopedia: colormap = color look-up table = indexed palettemel2000 wrote:In the png options I set transparency to palette entry 0 (whatever that means).
XnView v1.92 is due to be released this week. The new version will allow you to set transparency for non-palette-based (>256 colors) images.
- Download and install Guessous Mehdi's free Eraser Classic plug-in.
- Download xnview_full.png and open it in XnView.
- In View mode, go to Image » 32 bits.
- Then go to Filter » Adobe Photoshop Plug-In...
- In the Plugins manager, go to Mehdi, select Eraser Classic and click on the Start... button.
- In the Eraser Classic window, click on the eyedropper tool, move the mouse cursor over the white background in the preview on the left and click on it.
- Exit Eraser Classic by clicking OK.
- Exit the Plugins manager by clicking OK.
- Save the image in PNG format.
Thanks for your replies Clo and XnTriq. When I tried to implement your advice I ran into a serious shortcoming in XnView that will not allow me to complete my task in that application.
I found the settings for the alpha option and they were already checked. But there was no option to allow me to set a transparent color as with most graphics apps, so I still couldn't save any transparency in my 32 bit images without using a plugin.
My task was to use batch processing to set the canvas size to a 25 px white frame all around each of 10 png images (to make them look like a Polaroid snapshot - I wish we could set each side individually). Then I wanted to add a drop-shadow with transparency behind each framed image. That's it.
1.) The first issue was that XnView wouldn't allow me to convert the 10 png images to 32 bit all at once. That cut down on my productivity considerably.
2.) The most serious shortcoming was that the drop-shadow's background color was always white (not the drop-shadow itself) and there was no way to change it. That prevented me from using the eraser plugin to make the drop-shadow's background transparent since the frames of the images were also white.
3.) The 32 bit pngs were saved as 24 bit after the batch processing. I had no option to retain the 32 bit setting.
I hope I'm missing something here but I was hoping for so much better from XnView.
I found the settings for the alpha option and they were already checked. But there was no option to allow me to set a transparent color as with most graphics apps, so I still couldn't save any transparency in my 32 bit images without using a plugin.
My task was to use batch processing to set the canvas size to a 25 px white frame all around each of 10 png images (to make them look like a Polaroid snapshot - I wish we could set each side individually). Then I wanted to add a drop-shadow with transparency behind each framed image. That's it.
1.) The first issue was that XnView wouldn't allow me to convert the 10 png images to 32 bit all at once. That cut down on my productivity considerably.
2.) The most serious shortcoming was that the drop-shadow's background color was always white (not the drop-shadow itself) and there was no way to change it. That prevented me from using the eraser plugin to make the drop-shadow's background transparent since the frames of the images were also white.
3.) The 32 bit pngs were saved as 24 bit after the batch processing. I had no option to retain the 32 bit setting.
I hope I'm missing something here but I was hoping for so much better from XnView.