7

In my line of work I often work with images for print marketing from multiple sources and occasionally when I have asked for hi-res images (instead of initially the low-res ones that they start by giving me), I've been given deliberately upscaled ones instead, and occasionally might suspect the same for being given a TIFF that was simply converted from JPEG behind my back.

I know you can do it with audio files to detect fake lossless FLAC files.

So are there any pieces of software/tools to detect:

  1. resolution upscaling (even if more subtle, from say mid-res to hi-res).
  2. conversion from a lossy format like JPEG to TIFF or PNG.

Or would you have any advice and pointers for how to humanly try to check? Among my tools is Photoshop, of course.

4
  • LOL, ohh your the one. Customer comes and says you wont take anything but full high res original TIFF file. We say let me talk to them , they say "must be high res TIFF, OK THERE , high res TIFF. What do you expect? When we provide the Originals , the best that existed , there was nothing else to re-create the data from. What exactally are you expecting? Your working in the Print side of it, if you cant see nasty little boxes and blurring fron the Jpeg compression, then just have them sign a contract that says "its your data were just printing it" and go on.
    – Psycogeek
    Jan 25, 2012 at 23:39
  • The problem with seeing it in photoshop is, it is going to use alogrythms to zoom the data. I do not think there is a way to even set photoshop so it will show the data more Raw. ACD-SEE and some of the other viewer programs had settings where the alogrythms like bi-linear are shut off. When that is zoomed up on, to say 200% or 300% all you are seeing is its nasty original self, all the pixelation and noise and artifacts will show up fast.
    – Psycogeek
    Jan 26, 2012 at 0:03
  • Assuming the files you are checking photographs and not computer generated art, the only thing I can think of is check the metadata for the resolution and compression level, also check the picture's histogram and color count onto see how many colors are used, how often they are used and their distributed. Highly compressed files should have fewer colors that are used more often. Uncompressed pictures should have a wider distribution with the colors used fewer times. That said, I don't know of a programs that would automatically check these things. Jan 26, 2012 at 4:58
  • Software product recommendations are off topic outside of Software Recommendations, I would recommend changing your question from "is there any software to detect" to "how do I go about detecting" in order to avoid your question being closed.
    – Mokubai
    Dec 21, 2014 at 11:41

2 Answers 2

9

To address your second question:

How to detect conversion from a lossy format like JPEG to TIFF or PNG

A visual way to tell if an image has been previously JPEG compressed is to zoom in on the image and look for signs of discontinuities between 8x8 pixel blocks. These are particularly obvious if the JPEG compression was high (low quality).

Low quality JPEG
Low quality / High compression JPEG saved as PNG - 8x8 pixel blocks are clearly visible

But if the JPEG compression was low (high quality) then these blocks may be difficult to see...

enter image description here
High quality / Low compression JPEG saved as PNG - 8x8 pixel blocks are difficult to identify

So how to tell if this high quality image has been JPEG compressed at some point? JPEG compression deliberately drops more color information than intensity information and we can use Photoshop's Lab color mode to investigate further.

Convert your image to Lab color mode (Image -> Mode -> Lab Color). This converts the image from red, green and blue channels to L, a and b channels.

The L channel is the Lightness channel, essentially the greyscale version of the original image. The a and b channels are the color channels, but not in the traditional sense. A full explanation is not required for this answer but you can find more info on Wikipedia.

Inspect the a or b channel and look for 8x8 pixel blockiness.

enter image description here
'a' channel of previous image - 8x8 pixel blockiness visible, indicating JPEG compression

If either the a or b channels exhibit 8x8 pixel blockiness then that's a very good indication that the image was JPEG compressed at some point in the past.

1
  • 1
    Just a note for GIMP users: GIMP also supports LAB mode; it's under "Colors / Components / Decompose... / LAB".
    – sleske
    Dec 21, 2014 at 12:42
0

I'm late to the party but here's my few cents.

You can install PHP. It's available for Windows, Linux, OSX and more. Then you can create a text file, like this:

<?php
$url = 'http://server.com/image.png';
$data = json_decode(file_get_contents('http://api.rest7.com/v1/image_upscaled.php?url=' . $url));

if (@$data->success !== 1)
{
    die('Function failed');
}
if ($data->current_width !== $data->original_width)
{
   echo 'Upscaled photo';
}
else
{
    echo 'Not upscaled';
}

and it will tell you if a photo was upscaled or not. It's not 100% accurate but's automated and reasonably fast.

1
  • 1
    This answer is based of off this service to check if images are upscaled: rest7.com/image_upscaled. There they have several instructions for using their API including this PHP solution.
    – timotree
    Jun 17, 2017 at 17:00

You must log in to answer this question.