Copied PNGs have a black background instead of being transparent Topic is solved

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 784
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Copied PNGs have a black background instead of being transparent

Unread post by jobbautista9 » 2021-04-23, 09:58

When I try to copy a PNG with a transparent background from Pale Moon, some image editors don't see the transparency and places a black background instead. Currently I've only seen this happen in IrfanView on Wine. Someone on Reddit was complaining about the same problem on Firefox, and they used Google Slides and Photoshop.

Curiously this doesn't happen in GIMP, for some reason.

Can someone who is on Windows test if this also happens in IrfanView and Photoshop?

Relevant bugzilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1527235

Testcases: http://pluspng.com/img-png/skeleton-hd-png--350.png, https://bugzilla.mozilla.org/attachment.cgi?id=9043202
Image

merry mimas

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Mima avatar by 絵虎. Pixiv post: https://www.pixiv.net/en/artworks/15431817

Image

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Copied PNGs have a black background instead of being transparent

Unread post by Moonchild » 2021-04-23, 10:32

Save the image and it will always retain transparency.
Copying bitmaps with transparency to the clipboard is kind of hit-or-miss, since the native bitmap format for clipboard (DIB) does not support transparency, afaik. So it depends on multiple factors; you could have a PNG stream in the clipboard alongside the DIB to preserve transparency but the program you are pasting in will ALSO have to support that and pick that preferred over DIB. Stuff like that gets convoluted quick so the best way is to just save the PNG to disk and use it that way.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Lucio Chiappetti
Astronaut
Astronaut
Posts: 660
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: Copied PNGs have a black background instead of being transparent

Unread post by Lucio Chiappetti » 2021-04-23, 12:31

Confirm on second example (palemoon shows black bkg). Save Image as ...png. GIMP shows checkerboard where transparent, xv shows white.
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

User avatar
gepus
Keeps coming back
Keeps coming back
Posts: 943
Joined: 2017-12-14, 12:59

Re: Copied PNGs have a black background instead of being transparent

Unread post by gepus » 2021-04-23, 15:01

Can't confirm. No black bkg in Pale Moon (Win7).
I tested also with two different image software which I use alongside GIMP and the image gets rendered with transparent bkg.
Attachments
skeleton.png

New Tobin Paradigm

Re: Copied PNGs have a black background instead of being transparent

Unread post by New Tobin Paradigm » 2021-04-23, 15:25

On Windows some newer versions of programs can recover the transparent info if it is provided in the clipboard data but older applications won't know about it. Still, saving is the BEST solution.

User avatar
therube
Board Warrior
Board Warrior
Posts: 1651
Joined: 2018-06-08, 17:02

Re: Copied PNGs have a black background instead of being transparent

Unread post by therube » 2021-04-23, 20:39

(I couldn't say if I should be seeing black or white. Anyhow...)
.
png as seen void irfan palemoon.png
Win7. Void Image Viewer, IrfanView, & Pale Moon.
(Downloaded &) saved the images, first, then opened, externally. (Except for PM, simply click the link.)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Copied PNGs have a black background instead of being transparent

Unread post by Moonchild » 2021-04-23, 21:30

Like I said it depends on the software you are pasting in.

On Win 10, pasting in paint3d preserves transparency since it understands the datastream that has transparency embedded.
Older software may not, and as a result paste without the alpha layer.

That isn't a browser problem; the browser is putting the data on the clipboard as 32-bit (otherwise no program would be able to pull it transparently from it). I'm pretty sure I made that change in Tycho somewhere.

If you don't get transparency either when saving the image as a png to disk then your viewer is deficient when dealing with transparency
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
gepus
Keeps coming back
Keeps coming back
Posts: 943
Joined: 2017-12-14, 12:59

Re: Copied PNGs have a black background instead of being transparent

Unread post by gepus » 2021-04-23, 21:36

therube wrote:
2021-04-23, 20:39
(I couldn't say if I should be seeing black or white. Anyhow...)
As already has been explained, with decent graphic software you should see transparent bkg.

I know that IrfanView is very popular. I used it in the past myself but dumped it many years ago because some of its shortcomings.
Attachments
skel.png

Locked