Save as jpeg artefact in blue channel


#1

I’ve recently noticed that whenever I save an image as jpeg, pixel information will be written from the first to the third channel overlaying with what was in the third one.
Everything is fine if I save as either tiff or gif though. This becomes very obvious in 2 channel images that have been converted to RGB and the third channel is by definition black. Since this also overlays in 3 channel images and thus renders the information in the third channel partly useless, this is a massive issue for our image analysis.

This only happens when saving as jpeg in imagej/fiji. If I save the tiff version of the image as jpeg using photoshop this is also not the case.

Would anyone know why this is happening? And more importantly have any idea how to solve this issue? This suddenly started in ~February and was absolutely fine before that.

example of the tiff version

example of jpeg version

I’d be grateful for any help.

Andre


#2

Good day Andre,

no idea what happens with your images, but stay away from JPG-formatted images. They are unsuited for scientific work because they introduce compression artifacts.

I just did the following:

  1. Create an RGB-image in ImageJ with empty blue channel
  2. Save the image from ImageJ in TIF-format
  3. Save the image from ImageJ in JPG-format
  4. Open the TIF-image in Photoshop and save it in JPG-format
  5. Both JPG-images (3. & 4.) show a signal in the blue channel
    The difference of the blue channels depends on the compression factors.

So I can’t see any qualitative difference between ImageJ and Photoshop.

I don’t know how JGP-compression acts on color images but I’m pretty sure that the spurious signals in the blue channel are due to the compression.

Regards

Herbie


#3

Hi Herbie,

thanks for the reply. We always keep the original images. We only do jpegs for file exchange and a quick look at the data. Everything else is done on the original files or tiffs. Jpeg does save us a lot of HDD/server space. (20-odd mb instead of 800. We generate a couple of TBs raw data every day). Never had the channel problem before though…


#4

Sorry, but can you confirm the result of my test protocol?

Here is the TIF-image I’ve used:
Stack (RGB).tif.zip (65.9 KB)

Never had the channel problem before though …

Please confirm using the attached image.

Regards

Herbie


#5

I used your supplied image.

the blue channel is clean, all pixels black

I get the artefacts in the blue channel.

The blue channel is clean, all pixels black

Only 3 shows a signal in the blue channel.


#6

ah, you’re right, it’s in the photoshop jpeg version too. Just had to refresh/reload the image in photoshop…


#7

Thanks for testing.

I use Photoshop 10.0.1 under macOS. Perhaps this makes the difference to your finding.

I just tested again and with macOS Preview 8.1 as well.
All three applications (ImageJ 1.52a, Photoshop 10.0.1, Preview 8.1) produce spurious signals in the before empty blue channel when saved in JPG-format.

Perhaps someone else can chime in here and do some accompanying test.

Regards

Herbie

ADDITION:
Just saw your latest post.
So all is at least consistent and it appears as if you have to decide between disc space and artifacts.


#8

:roll_eyes: seems so… thanks for your help.