Hi,
when copying a PNG that contains an alpha channels to the clipboard with XnView the pixel data is not premultiplied by the alpha channel. When I copy the same PNG to the clipboard using Firefox or Chrome, however, the pixel data is premultiplied by the alpha channel data. AFAIK there is no official consensus as to whether or not pixel data should be premultiplied but if Firefox and Chrome do it, it might be considered an unofficial standard and maybe XnView should be adapted to premultiply as well.
See here for a further discussion on alpha channel data in the clipboard:
http://stackoverflow.com/questions/1568 ... nel-images
Tks
EDIT: Also, XnView doesn't seem to support the alpha channel when pasting an image. It always appears opaque.
Win32: Alpha channel clipboard format
Moderators: XnTriq, helmut, xnview
-
- Author of XnView
- Posts: 44448
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: Win32: Alpha channel clipboard format
Hi,
You want to copy in which software?
You want to copy in which software?
Copied from which software?andy82 wrote: EDIT: Also, XnView doesn't seem to support the alpha channel when pasting an image. It always appears opaque.
Pierre.
-
- Posts: 3
- Joined: Fri Mar 29, 2013 11:02 am
Re: Win32: Alpha channel clipboard format
Actually I want to copy to my own software. But transparency is also lost when pasting into Word 2010 or Paint.NET, for instance. My own software looks for a CF_DIBV5 on the clipboard and when the data comes from XnView, then the colors aren't premultiplied. When the data comes from Firefox or Chrome, the colors are premultiplied so I think XnView should premultiply as well.You want to copy in which software?
From XnView itself Just try it: Open a alpha channel PNG in XnView, copy it to the clipboard, open another image and try to paste the clipboard image... you'll see that transparency is gone now!Copied from which software?
Note that there seems no official way of dealing with alpha channel data in clipboards. We recently discussed this in detail on StackOverflow:
http://stackoverflow.com/questions/1568 ... nel-images
-
- Author of XnView
- Posts: 44448
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: Win32: Alpha channel clipboard format
Strange, i've checked, and i don't export in CF_DIBV5 only CF_DIBandy82 wrote:Actually I want to copy to my own software. But transparency is also lost when pasting into Word 2010 or Paint.NET, for instance. My own software looks for a CF_DIBV5 on the clipboard and when the data comes from XnView, then the colors aren't premultiplied. When the data comes from Firefox or Chrome, the colors are premultiplied so I think XnView should premultiply as well.You want to copy in which software?
right the same problem with clipboard...From XnView itself Just try it: Open a alpha channel PNG in XnView, copy it to the clipboard, open another image and try to paste the clipboard image... you'll see that transparency is gone now!Copied from which software?
Note that there seems no official way of dealing with alpha channel data in clipboards. We recently discussed this in detail on StackOverflow:
http://stackoverflow.com/questions/1568 ... nel-images
Please contact me by email...
Pierre.
-
- Posts: 3
- Joined: Fri Mar 29, 2013 11:02 am
Re: Win32: Alpha channel clipboard format
That's normal. Windows does automatic format conversion between several clipboard formats. So if an app requests CF_DIBV5 but there is only a CF_DIB on the clipboard, Windows will convert it automatically.Strange, i've checked, and i don't export in CF_DIBV5 only CF_DIB
See "Synthesized clipboard formats" here:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
Email sent.Please contact me by email...
-
- Author of XnView
- Posts: 44448
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: Win32: Alpha channel clipboard format
do you have received my reply?andy82 wrote: Email sent.
Pierre.
-
- Posts: 1
- Joined: Thu Apr 04, 2013 1:29 pm
Re: Win32: Alpha channel clipboard format
Hi, I'm a long time reader, but this topic has finally prompted me to register, so here goes...
I have always struggled with 32-bit copy/paste, and I still use v1.97.8 as this is the last version that I can make it work in.
v1.97.8
32-bit Copy / Paste: works OK (as long destination image is also 32-bit)
32-bit Copy / Import clipboard: clipboard imported as 24-bit (without alpha layer), but then you can convert the newly created image to 32-bit, and paste the clipboard over it again, and now it works.
v1.98-v1.99
Neither of the above work for me (on XP SP3), I have tried every combination of alpha/32-bit settings I can find, and I just cannot get 32-pasting to work by any means.
I assume that the problem occurs in the pasting, not the copying, as I can copy from 1.98/99 then paste this into 1.97,
but I cannot copy (successfully) from 1.97 into 1.98/99.
Now for some l-o-n-g overdue gratitude - thank you Pierre, I have used XnView for years and would be lost without it, and also to all the others who contribute to XnView and this forum.
Cheers, Simon.
UPDATE: Thank-you, the new v2.0.0 fixes these issues completely.
I have always struggled with 32-bit copy/paste, and I still use v1.97.8 as this is the last version that I can make it work in.
v1.97.8
32-bit Copy / Paste: works OK (as long destination image is also 32-bit)
32-bit Copy / Import clipboard: clipboard imported as 24-bit (without alpha layer), but then you can convert the newly created image to 32-bit, and paste the clipboard over it again, and now it works.
v1.98-v1.99
Neither of the above work for me (on XP SP3), I have tried every combination of alpha/32-bit settings I can find, and I just cannot get 32-pasting to work by any means.
I assume that the problem occurs in the pasting, not the copying, as I can copy from 1.98/99 then paste this into 1.97,
but I cannot copy (successfully) from 1.97 into 1.98/99.
Now for some l-o-n-g overdue gratitude - thank you Pierre, I have used XnView for years and would be lost without it, and also to all the others who contribute to XnView and this forum.
Cheers, Simon.
UPDATE: Thank-you, the new v2.0.0 fixes these issues completely.
-
- Posts: 15
- Joined: Fri Mar 29, 2013 2:14 pm
Re: Win32: Alpha channel clipboard format
For me this is still an issue. I opened my transparent png directly from Word and then copy-pasted through selection and clipboard (XnView 2.0.4 in Win 7).XnView doesn't seem to support the alpha channel when pasting an image. It always appears opaque.
You can see the original image in XnView and the two versions in Word:
(1) opened directly from Word and (2) selected and copied through clipboard
-
- Author of XnView
- Posts: 44448
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France