Screenshots are compressed when saved to clipboard
24" iMac 3.06 GHz, Mac OS X (10.6.6), 8 GB RAM
24" iMac 3.06 GHz, Mac OS X (10.6.6), 8 GB RAM
The program I'm pasting into is full-on PHOTOSHOP. If the image on the clipboard is not compressed or dithered, Photoshop can handle it just fine. But that is not the case; the image on the clipboard is not the same as the image that gets saved to a file with Apple's built-in screen capture utility.
For example, if I create a new image in Photoshop that is a solid color, I can then use the Magic Wand tool (with tolerance set to 0) and click anywhere, and every pixel gets selected because every pixel is the same color. If I were to then take a screenshot of that same image so that the image gets copied to the clipboard, and then paste that image into a new Photoshop document, clicking on the colored area will select a dithered portion of that area because at some point, some kind of compression or dithering has been added to the image. You can verify this by converting the pasted image to grayscale and increasing the contrast until the dithering becomes visible.
I need pixel-perfect, 24-bit screenshots with no compression or dithering.
> A screenshot normally does get saved to the clipboard in .png format, and Jeffrey has told you
Okay, so it's not actually a JPEG, but it's acting like a JPEG—or a dithered, 8-bit PNG—in that artifacts are introduced to the image before saving to PNG. The same thing happens if you change the save format to TIFF with the Terminal.
> It is the program that receives the image that changes it.
Sorry, but you're wrong here. This is Photoshop. I can take any other image that's already in Photoshop, copy it, and paste it into a new Photoshop document, and the dithering I'm describing does not happen. It only happens at the moment the screenshot is taken.
I was experiencing the same issue as the original poster:
I captured a screenshot to the clipboard (Control + Command + Shift + 3) and pasted into Photoshop and the screenshot was compressed with noticeable artificats. The same result when I saved a screenshot to the desktop.
This seems to be due to the fact that I changed my default capture format to JPEG (from PNG).
When I changed the capture default back to PNG (via: defaults write com.apple.screencapture type png, then killall SystemUIServer) and copied to the clipboard, it pasted into Photoshop without any compression.
Hopefully this helps. But yeah, you'd think that copying a screenshot to the clipboard would capture the screenshot independent of the fileformat you choose to save it in, but what do I know... 😕
A screenshot is not a copy from the application whose window is contained in the screenshot, it is a pixel by pixel copy of what is on the display, with whatever antialiasing and dithering the display uses to represent what is in the actual document.
When I take a screenshot to the clipboard, and then run the AppleScript:
clipboard Info
I get this:
clipboard info
--> {{«class PNGf», 221662}, {«class 8BPS», 426386}, {«class BMP », 582174}, {«class TPIC», 422466}, {TIFF picture, 588930}, {«class jp2 », 45811}, {GIF picture, 58908}, {JPEG picture, 57789}}
As you can see, the information is stored (not saved) on the clipboard in eight formats, including PNG and JPEG. Which format is used in the Paste operation would depend on the application doing the paste.
Solution: If the Photoshop document I paste the clipboard contents into is a 16 bit file, then the dithering does not appear. I don't see why I should have to do that, though, since a screenshot saved to disk is saved in 8 bit.
Better solution: I can select "Don't Color Manage this Document" as the color profile for an 8-bit document and the dithering doesn't appear, either.
So in short, the dithering was caused by Photoshop's default color profile. Which is odd, though, because shouldn't that just shift the colors, and not add dithering?
Screenshots are compressed when saved to clipboard