Editing an images loses its transparency

Bugs found in XnView Classic. Please report only one bug per topic!

Moderators: XnTriq, xnview

User avatar
Brother Gabriel-Marie
Posts: 259
Joined: Thu Aug 23, 2007 2:33 pm
Location: United States

Re: Editing an images loses its transparency

Post by Brother Gabriel-Marie » Wed Dec 17, 2014 3:44 am

Okay, steps 1-4 were the same for me,
but I didn't use export.
In my configuration, it either autosaves when I move to another image, or I click the save button on the toolbar. It always overwrites by default.
I don't know if that makes any difference - you wouldn't think so.

Of course, if I open even the original opossum.png, you can't see the transparency in XnView anyway. (I can see it in XNviewMP, but not in XnView.) It only shows in the thumbnail as long as I don't make any edits with XnView. When you open opossum.png in your XnView 2.25, does it display the transparency? Mine never displays transparency for png files in the viewer.

I know it scrambles the transparency, because if I open the xnview-edited one in Photoshop, I have to erase all the background again.

- I confirm that in my General > Read/Write > Read settings for png that "compose image with transparency" and "compose image with alpha" are both checked. And in write for png, the setting is checked for "Set the transparency value to palette entry 0".
- I also confirm that in General > Operations, "Ignore alpha channel" is unchecked.
- I confirm that in General > Read/Write > General, that "Remove alpha channel if output format doesn't support it" is unchecked.

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

Re: Editing an images loses its transparency

Post by XnTriq » Wed Dec 17, 2014 4:00 am

Please deactivate the following checkboxes in XnView Classic:
  • Tools » Options... » Read/Write » Read » PNG » Parameters
    • Compose image with transparency
    • Compose image with alpha (32bits)
  • Tools » Options... » Read/Write » Write » PNG » Parameters
    • Set the transparency value to palette entry:
XnTriq ([url=http://newsgroup.xnview.com/viewtopic.php?p=120358#p120358]BUG: Image transparency display is not consistent...[/url]) wrote:Recommended settings:
  • Tools » Options...
    • General » Operations » Ignore alpha channel = Off (Thanks, cday!)
    • Read/Write » Read » PNG » Parameters » Compose image with transparency = Off
    • Read/Write » Read » PNG » Parameters » Compose image with alpha (32bits) = Off
    • View » View » Background colour = R128/G128/B128 (optional)
    • View » View » Use checkerboard pattern as background = On (optional)
    • Fullscreen » Background colour = R128/G128/B128 (optional)
  • Browser mode: View » Preview
    • Use transparent index (<=8bits) or alpha channel = On
    • Use alpha channel = On
    • Show Mask = Off
  • Viewer mode: View
    • Use transparent index (<=8bits) or alpha channel = On
    • Use alpha channel = On
    • Show Mask = Off
[color=green]xnview.ini[/color] (optional) wrote:

Code: Select all

[View]
CheckerColor1=8947848
CheckerColor2=8421504
CheckerSize=8
XnView Wiki (UI-less Settings » [url=http://www.xnview.com/wiki/index.php?title=UI-less_Settings#View]View[/url]) wrote:
CheckerColor1
  • Changes the first color of the checkerboard pattern background.
    Value: Raw color (integer) or formatted color string
CheckerColor2
  • Changes the second color of the checkerboard pattern background.
    Value: Raw color (integer) or formatted color string
CheckerSize
  • Changes the size of squares in the checkerboard pattern background.
    Value: Integer, default value is 8
XnTriq ([url=http://newsgroup.xnview.com/viewtopic.php?p=50166#p50166]PNG with transparency not showing[/url]) wrote:
wolfgangbeyer wrote:In XnView transparency is not edited but only displayed, so far I understand. So I don’t understand the option Tools » Options » General » Read/Write » Read » PNG » Parameters » Compose ...
I'd be happy to give you a definitive answer, but – as mentioned before – I never completely figured out what impact these parameters have, how they “interact” with each other, and why they are available for PNG format only. :?
What I have to offer is the configuration I finally settled on after going through a fair amount of trial & error work:
  • General » Read/Write » Read » PNG
    • Parameters
      [  ] Compose image with transparency
      [  ] Compose image with alpha (32bits)
  • View » View
    • Auto Image Size [Fit image to window, large only]
    • Background colour [R128/G128/B128]
    • [×] Use transparent index (<=8bits) or alpha channel
wolfgangbeyer wrote:Or does off means to ignore the transparent/alpha maske and display the hidden colors in the RGB channels, which are actually intended not to be visible due to the transparency? Than off as default seems nonsense for me.
Yes, that's my interpretation of Use transparent index (<=8bits) or alpha channel too.
BTW: Just recently the possibility to switch transparency off turned out to be crucial in identifying a problem.

These options have been discussed in many threads. I'd like to bring two of them in particular to your attention, where you will find some comments from Pierre:

User avatar
Brother Gabriel-Marie
Posts: 259
Joined: Thu Aug 23, 2007 2:33 pm
Location: United States

Re: Editing an images loses its transparency

Post by Brother Gabriel-Marie » Wed Dec 17, 2014 4:15 am

xntriq - wow - now THAT is an answer!

Okay, I tweaked the settings for png in read/write and that made the difference. I also enabled the checkered background.
I confirm that the edits are not removing the transparency anymore.

Thank you very much!
I'll have to go looking to see just what those settings did (I believe they were default, but I can't remember, it's been so long that I've been using XnView).

User avatar
Brother Gabriel-Marie
Posts: 259
Joined: Thu Aug 23, 2007 2:33 pm
Location: United States

Re: Editing an images loses its transparency

Post by Brother Gabriel-Marie » Tue Apr 12, 2016 4:16 pm

Does anyone know if this has been fixed for XnView MP?

User avatar
omniplex
Posts: 127
Joined: Thu Feb 10, 2011 1:52 pm
Location: Hamburg
Contact:

Re: Editing an images loses its transparency

Post by omniplex » Mon May 16, 2016 4:46 am

wow - now THAT is an answer!
Second, I'm using XnView for years and didn't have the correct PNG read options, let alone the fascinating checkerbox INI settings. And I didn't know the UI-less_Settings page. :o

Post Reply