Who's compressing my JPEGs: Gmail, iPad, or WordPress?
April 16, 2013 8:29 AM   Subscribe

The other day I discovered that some JPEGs I'd posted to my (self-hosted) WordPress blog had been compressed. The subject of my blog happens to be anaglyph 3D photos... and if the images are not saved at a very high resolution, a phenomenon called "ghosting" or "crosstalk" appears, where parts of the image that are only supposed to be visible to one eye are visible to the other eye as well. This can ruin the 3D effect. So it's important that my images are uploaded and posted with no added compression. The problem is that I don't know exactly where the problem occurred. Details below...

These particular images got to my blog somewhat circuitously: after exporting them from Photoshop on my PC at a very high resolution, I attached them to a Gmail message... then I downloaded them to my iPad's photo gallery... and then I uploaded them to the blog via the iPad WordPress app. Upon viewing the posted images, I could see a very definite degradation of image quality.

What I'm trying to figure out is which step in the chain caused this. I've sent image files thru Gmail many times, and never noticed any compression, so I'm assuming/hoping that's not where it happened.

I know that Apple often has stuff going on under the hood of its hardware and software that isn't clearly explained to users (which is why I've been wary of the iPad, and have only started using this hand-me-down unit recently). So it's my prime suspect. I looked for settings that might control image compression, but couldn't find anything that mentioned it or would allow me to prevent it from happening.

Then there's WordPress. When I upload multiple photos using the WordPress Media Uploader on the PC, there is a message that appears that says "Crunching..." My research suggests that the original images are not being compressed during this process, but rather that multiple image sizes are being created. Ultimately I've decided to upload images from my PC by inserting them individually into posts; the Media Uploader seems to handle this without any visible quality loss. But what the iPad WordPress app may or may not be doing to my images is still a mystery to me.

I'd really like to know where the problem occurred. It would be nice to be able to upload stuff from the iPad to the blog -- if this unwanted compression can be eliminated. I'm also thinking about buying the iPad Camera Connection Kit... but I don't want to try moving photos from my cameras thru the iPad to email or cloud storage, if it's going to mess them up.

Can anyone shed any light?
posted by Artifice_Eternity to Technology (20 answers total)
It's probably the ipad. It probably compresses images to save space but still "look good" on the ipad screen.

Do you run into this same problem if you save the files as png?
posted by royalsong at 8:35 AM on April 16, 2013 [1 favorite]

I would guess that the upload to WP is the culprit, based on google search results like this one (also offers a possible solution to the problem). Have you tried outputting to a lossless format like PNG?
posted by Salvor Hardin at 8:35 AM on April 16, 2013 [3 favorites]

Response by poster: Thanks for the PNG suggestion. I'll look into this. But I wonder if it will significantly slow down page load times for my blog. That would not be ideal.
posted by Artifice_Eternity at 8:53 AM on April 16, 2013

Look at the images in your iPad photo gallery. Do they show the image degradation? You can pinch to zoom in on them there to get a higher resolution view. If that's not sufficient, you can mail the images back to yourself from the iPad photo gallery and see if the roundtrip has caused any changes to the images.

I also agree with previous posters that lossless compression via PNG would be preferable.
posted by alms at 8:54 AM on April 16, 2013

Response by poster: Salvor Hardin: It looks to me like that WP image compression tip (which I did come across when researching this issue) only applies to the resized images that WP generates.
posted by Artifice_Eternity at 8:54 AM on April 16, 2013

Response by poster: alms: Excellent suggestion! I hadn't thought to do this. I will check the iPad gallery images as soon as I have my iPad handy.
posted by Artifice_Eternity at 8:55 AM on April 16, 2013

Is your EXIF data preserved? That might yield further clues; look at things like timestamps.
posted by oceanjesse at 9:34 AM on April 16, 2013

I don't know about the ipad and WordPress, but I would stake money that gmail is not doing it. The expectation with email attachments is always that you get out, bit-for-bit, what you put in. If Google started doing this there would be a lot of very angry people.

PNG is an interesting idea but I suspect that it would increase your file sizes pretty significantly, even compared to a maximum-quality JPEG.
posted by pont at 9:38 AM on April 16, 2013

In the WordPress iPad app, is there a Settings > Media > Image Resize setting? I see it in this iPhone screenshot but I'm not 100% sure what that even does. If it touches your originals, I think that's the problem -- but if it's just modifying the normal WP-created versions then that's a red herring.

I have never had a problem with Gmail modifying emailed files, and I have had many oddball files go in and out of there without modification.
posted by artlung at 9:51 AM on April 16, 2013

Response by poster: pont: I agree about Gmail, which is why I suspect it's not the culprit. In fact, I may look into uploading images to WordPress via email as a workaround for this problem.

As for PNGs: I just ran a test, saving one of my JPEGs as a PNG using Fireworks. The file size increased nearly tenfold. Given that the index page of my blog features lots of high-res photos, turning them all into PNGs would be murder on page load time. I just don't think it's an option for me.
posted by Artifice_Eternity at 9:53 AM on April 16, 2013

Response by poster: artlung, I'll check that when I'm home from work today and have access to my iPad. Thanks for the suggestion.
posted by Artifice_Eternity at 9:54 AM on April 16, 2013

Resolution aside, there is a JPEG setting which means "don't degrade" otherwise JPEG compression is by definition lossy. Png is the way to go to get exactly the pixels you intend. You might want to link thumbnails to the large images to keep page loads snappier, but generally speaking a 170k png isn't going to load much slower than a 120K jpeg.
posted by plinth at 9:56 AM on April 16, 2013

Response by poster: oceanjesse: I'll have to run an image thru the Gmail > iPad > WordPress circuit tonight and see how the EXIF data looks afterward. I know that my current routine -- uploading images from my PC into individual WP posts -- preserves all EXIF data.
posted by Artifice_Eternity at 9:57 AM on April 16, 2013

Response by poster: plinth: My test just now involved a 114kb JPEG... which became a 1105kb PNG. Maybe Photoshop (which I don't have access to at the moment) saves smaller PNGs than Fireworks? I don't know.
posted by Artifice_Eternity at 9:59 AM on April 16, 2013

What are the dimensions of the original? Are you willing to post one? I work in image processing and have written jpeg and png codecs...
posted by plinth at 10:29 AM on April 16, 2013

Response by poster: I had a link to my blog in the original post, but I guess the mods took it out for some reason. Here's one of the images.
posted by Artifice_Eternity at 11:28 AM on April 16, 2013

Here's the image in png - 487K.

It will take 3x to download. I used ImageMagick to convert. I'm home ill so I don't have access to my own tools, otherwise I could tell you what compression settings it used. Likely it just used the default LZW with Paeth predictor.
posted by plinth at 12:04 PM on April 16, 2013

Response by poster: Thanks for that. Looks good. I think I'm still going to look for a workflow that lets me stick with JPEG... but it's nice to know of this possibility.
posted by Artifice_Eternity at 12:09 PM on April 16, 2013

Lead developer for WordPress (the web app) here. The WordPress web app won't touch your full resolution files. Those will pass through. The intermediate JPEG sizes it generates (based on Settings — Media, plus any other sizes your theme or plugins may have added) are, by default, done at a quality factor of 90 (this is on a scale of 1-100). There is a filter where you can override this with a simple plugin (hook in and just return 100): 'wp_editor_set_quality'. As of WordPress 3.5, we also use ImageMagick for better quality resizes (that preserve color profiles), if that is available on your server.

It appears that the WordPress iOS app (I'm not a contributor to it) does do JPEG re-saving. So that's the culprit.

So you have two options: use the web interface (you can probably do this from Safari on your iPad without quality loss — I think Safari just passes the file off) to upload photos so they're not altered, or switch to PNGs, which are going to be huge, but will be pixel-perfect.
posted by markjaquith at 2:21 PM on April 16, 2013 [8 favorites]

Response by poster: markjaquith: Thanks very much for the info!  I did a little more research tonight, and I'm sure you're correct that the iOS WP app is doing the compression.

I looked at the images I saved from Gmail to the iPad, and found that they show signs of compression -- at least when viewed on the iPad. 

However, I learned today (while researching the iPad Camera Connection Kit) that the iPad Photos app does not necessarily display the original files -- apparently it displays copies, while retaining the original files as well.  And those original files can be transferred off the iPad, via email or cloud, intact.  Why?  Only Steve knows, and he ain't telling.  Ah, the inscrutable mysteries of the walled garden.

I confirmed this by emailing one of these images to myself and then downloading it to my PC.  It is byte-for-byte the same "size on disk", has all the same EXIF data (except the filename), and looks absolutely identical to the file I originally mailed from the PC to the iPad.

Ergo, the iOS WP app is the only remaining suspect.  I'm just going to bypass that app when uploading images from now on, and use it exclusively for other blog tasks.

Thanks to everyone who supplied info and suggestions.
posted by Artifice_Eternity at 7:29 AM on April 17, 2013

« Older best iphone scanner apps?   |   Help me prepare to talk to a real estate lawyer. Newer »
This thread is closed to new comments.