Copying image with transparency gives black background




15 years ago
4 years ago


(Reporter: tunah.bugzilla, Unassigned)



Windows XP
Bug Flags:
wanted1.9.1 +

Firefox Tracking Flags

(Not tracked)




(2 attachments)



15 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.0

If you copy an image with transparent or translucent areas, the pasted image
will be composited against a black background, rather than the transparency
information being preserved.
This occurs both with GIF and PNG.

Reproducible: Always
Steps to Reproduce:
1. Visit
2. Right click on topic icon in top-right corner, select "Copy Image"
3. Open MS Paint (or any other graphics app)
4. Select Edit->Paste

Actual Results:  
Image pasted with black rectangle in background.

Expected Results:  
Image should be pasted as-is, with transparency preserved.

This may or may not be platform-specific, I have only tested on Windows XP.

Comment 1

15 years ago
I see this with W2K FF 0.9.3 and FF 20040901 using the images
Ever confirmed: true

Comment 2

14 years ago
Still reproducible in 1.8:
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b) Gecko/20050217

Testing page:

Comment 3

11 years ago
Still fails
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b3pre) Gecko/2008011105 Minefield/3.0b3pre

Comment 5

11 years ago
Works fine on Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9) Gecko/2008061017 Firefox/3.0 ID:2008060309, but apparently still fails on Windows:
Duplicate of this bug: 452846
Posted image testcase (GIF)
testcase image (GIF) from bug 452846
Posted image testcase (PNG)
testcase image (PNG) from bug 452846
Assignee: general → nobody
Keywords: testcase
QA Contact: ian → general


11 years ago
Flags: wanted1.9.1?
Duplicate of this bug: 444614
Is the issue that it's being composited against black rather than white?  We're clearly putting a 24-bit DIB on the clipboard I think, so maybe we need to offer some other flavours here as well..
Flags: wanted1.9.1? → wanted1.9.1+
Priority: -- → P3

Comment 11

11 years ago
If it makes you all feel better, this issue occurs in Google Chrome also, so it would be sweet for 1.9.1 to have this added. I copy images to other apps all the time, so this is something I constantly run into.

Sorry I added nothing to this bug, but I had to say that.

Comment 12

10 years ago
And if this makes anybody feel better, the issue also seems to occur with IE7;) (I am not 100% sure, though, might be that the GTK+ code I am testing with also has some buglets.)

Comment 13

10 years ago
Note that as far as I know, the only officially documented DIB format with per-pixel-alpha is one with a BITMAPV4HEADER or BITMAPV5HEADER, compression BI_BITFIELDS and then an appropriate bV4AlphaMask or bV5AlphaMask. Unfortunately, though, it seems that if you explicitly (in a test program that fills in all fields "manually" without relying on any other code) create a .bmp file that contains such a DIB, it won't display correctly in Firefox, Explorer, or IE7. It will load correctly into GIMP and PixelFormer (a small commercial bitmap graphics editor), but not into Photoshop Elements 5.

I am not 100% sure if I tested this, I was hacking like crazy last weekend on copy/paste of images between GTK+ and other apps on Windows, but I think I saw that none of the apps I tested with managed to paste from the clipboard correctly a DIB in the above BITMAPV5HEADER 32-bit BI_BITFIELDS with alpha format, though.

I think it would be great if Firefox would offer images on the clipboard also in the unambiguous PNG format. (Simply a PNG image stored in the clipboard as the named clipboard format "PNG".) For instance Word and Powerpoint offer images in that format, and GTK+ on Windows will in the future, too.


10 years ago
Product: Core → Core Graveyard


10 years ago
Duplicate of this bug: 484782


9 years ago
Duplicate of this bug: 546161
Duplicate of this bug: 530280

Comment 17

9 years ago
This does now work in IE8 and Chrome 4, at least under Windows 7 pasting into Office 2010 applications.  It doesn't work with Paint for any browser, so that could be an application limitation.

Comment 18

9 years ago
(In reply to comment #17)
Paint has never supported alpha transparency.


9 years ago
Duplicate of this bug: 596934
I see this all the time copying pngs to the clipboard and it's really pretty awful. I know it's late in this dev cycle, but there isn't a post-2.0 nomination. How do we say "pretty please for"? This might not be a super-high priority, but I'll bet there are plenty of designers out there who, like me,  regularly curse us for it.
Component: GFX → Graphics
Product: Core Graveyard → Core
QA Contact: general → thebes
Duplicate of this bug: 490342

Comment 22

8 years ago
This has been here for a long time, and pretty much slipped under the radar, but has annoyed me since time eternal, and hope that someone will be able to devote time for this. I can also confirm that it is present in windows 7, even when no other browsers exhibit this bug, and for that, I would consider it at least medium-high priority.


8 years ago
Duplicate of this bug: 695271
this is a dupe of bug 460969 (because it contains a patch)
Last Resolved: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 460969

Comment 26

4 years ago
I suppose I should jump in here and say that this is still, 11 years later, a bug. It's affecting me nearly every day. Is there really no way to solve this? I assume there probably is, seeing as other browsers have managed.
You need to log in before you can comment on or make changes to this bug.