-1

Many factors affect the true resolution of an image — the actual detail resolvable — including lens quality, sensor size and technology, noise and noise reduction, motion blur and camera technique, and even just the subject. It's essential to have enough pixel resolution to capture this, but more than that seems like waste.

I have a lot of pictures from my smartphone or my sports camera that may just have too many pixels. Is there a software way to detect this "overweight" and reduce it? (Preferably, command line on Linux.)

If there is no existing tool, I'll try a script or a Python program, but then the hardest part would be "define picture overweight": I can easily fetch resolution and other values from exiftool, but I would need a parameter like "how much are contiguous pixel similar", which, when very high, would mean that resolution is too high (i.e. can be reduced without perceptible loss of quality). Any hint here?

closed as unclear what you're asking by dpollitt, Itai, Philip Kendall, inkista, TFuto Feb 19 '16 at 13:24

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    What is the real problem you're trying to solve? Not enough memory on the phone? – Jim Garrison Feb 19 '16 at 3:54
  • So you would reduce a foto of the sky to 2-3 pixels (because ALL contiguous pixel are similarly blue)? – Zenit Feb 19 '16 at 7:57
  • I'm pretty sure I know what you're getting at — I don't think it's unclear. It still might not be actually possible, though, but that's a different issue, so I've voted to reopen. – mattdm Feb 19 '16 at 15:12
  • If some files contain useless data in them, it can and should be removed, right? I think this question is legitimate. – gb. Feb 22 '16 at 8:39
  • @JimGarrison I have backup scripts, I synchronize my folders everywhere, and smaller files is better for this. I also dislike being tricky by manufacturers with "billions of pixels" ads when the actual picture resolution is lower. – gb. Feb 22 '16 at 8:49
4

I have a lot of pictures from my smartphone or my sports camera that may just have too many pixels. Is there a software way to detect this overweigth and reduce it? Preferably command line on linux.

Too many pixels for what? No software can know ahead of time what you plan to do with these images or what an acceptable decrease in quality might be, so no software can automatically drop the resolution in a way that's appropriate for all cases.

If there is not existing tool, I'll try a script or a python program, but then the hardest part (for me) would be "define picture overweight"

That's exactly the problem. What counts as "overweight" for printing at 4x6" might be "not nearly enough pixels" for printing at 16x24".

I would need a parameter like "how much are contiguous pixel similar", which, when very high, would mean that resolution is too high (i.e. can be reduced without perceptible loss of quality). Any hint here?

This is exactly what compression algorithms like JPEG do, and in the case of JPEG there's a parameter that helps to determine how much quality can be lost in the name of making the file smaller. So, in that sense the answer is yes, there is an existing tool, and it's just a matter of saving your images in JPEG format. There are also compression formats that make the file smaller with zero loss in quality because they are lossless formats, i.e. they don't throw away any data. PNG is one such format.

  • "Too many pixels for what?" Is it not the case that some cameras do record their own noise? This seems obvious when taking a picture at night. Then this, for example, do not need to be stored and can be safely removed from the files. And jpeg algorythm has no way to know. – gb. Feb 22 '16 at 8:53
  • @gb. How do you know which pixels are noise and which are part of the image? Some cameras can do that, actually, by recording a "dark" frame to see just the noise, and then subtracting that from the image. You still end up with the same number of pixels in the image, they're just better (less noisy, more correct) pixels. – Caleb Feb 22 '16 at 14:55
  • 1
    Noise is random by definition. Even after dark field subtraction you have noise. This is a basic fact of physics that cannot be bypassed. Especially on a smartphone camera with its tiny sensor. – Jim Garrison Feb 22 '16 at 16:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.