1

I thought that Chrome copies a source image to clipboard, but it creates a PNG representation and pastes the representation to a clipboard when I use a context menu button 'Copy Image'.

enter image description here

I checked this in Safari and received same image.

Why does browser copy PNG instead of source image?

3
  • 1
    This is very unclear. How are you extracting the image? If you just drag from browser to desktop, you'll get whatever format the image was. If you screenshot it, you either get a png file on your desktop, or it copied to the clipboard, depending on your key combo.
    – Tetsujin
    Commented Jul 23, 2021 at 8:40
  • I have edited the description. Commented Jul 23, 2021 at 9:00
  • OK, thanks. Makes much more sense now. :) It's actually not an implementation I ever use, I just drag them to the desktop usually.
    – Tetsujin
    Commented Jul 23, 2021 at 9:20

1 Answer 1

1

I checked and found the same behavior : An image can be saved as-is, but copying to the clipboard is only in PNG format.

This is a question of implementation: The new Asynchronous Clipboard API is currently being implemented in all major browsers.

In Chrome, it started out with support for text/plain and image/png. In November 2020 was added text/html support for async clipboard api, and later in July 2021 Clipboard API: Svg.

More formats will surely follow, but for the moment JPG images are converted to PNG on the clipboard. This is a strange and narrow-minded implementation, but that's the current situation in Chrome. For example, Firefox does not have this limitation.

3
  • Interesting. I'd never have noticed this. The Mac's 'native' screen capture format has been png since maybe Panther or so. I'd have been more surprised had it been using lossy jpgs.
    – Tetsujin
    Commented Jul 23, 2021 at 11:40
  • @Tetsujin: Converting JPEG to PNG is surely a lossy proposition, so would have better been avoided.
    – harrymc
    Commented Jul 23, 2021 at 11:46
  • It's already been decompressed & colour-managed to display it, so it's not beyond the realms of possibility someone thought it best not to compress it once more. I'm not really defending the decision, but png is pretty robust.
    – Tetsujin
    Commented Jul 23, 2021 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .