I get weird results when displaying a PPM:

(this is actually an upscaled PNG)

And here's what the file looks like:

enter image description here

The dimensions are fine (10 rows, 8 columns), just the colors are wrong (or am I wrong?).

As it says in the 3rd line of the file, I want to use a value from 0 to 255 per channel. Using an usual rgb color space like (255, 255, 255) for white, (0, 0, 0) for black, (255, 0, 0) for red and so on. But those colors in the image are apparently not the same as in the file.

Already at the first look, the image seems way to dark.

Do I misunderstand the format? Is the file not interpretated this way?

(Wasn't completely sure if this is the place to ask, or stackoverflow. But thought you might have an idea.)

  • How did you convert the PPM to a PNG?
    – Jongware
    May 26 '20 at 17:42
  • I'm struggling to understand what "Parts Per Million" has to do with an image at all. Perhaps the acronym you are using means something else? Not really sure this is a "design" question at all.
    – Scott
    May 26 '20 at 17:50
  • @Scott PPM seems to be an image format for netpbm which is a package of graphics programs and a programming library. I agree, this isn't a graphic design question. Not sure where to ask though. Computer Graphics SE maybe?
    – Billy Kerr
    May 26 '20 at 18:19
  • Interesting... I've never heard of netpbm.. that, obviously, doesn't mean anything regarding its viability/usefulness. :)
    – Scott
    May 26 '20 at 18:23
  • @Scott - me neither, till I googled it ;)
    – Billy Kerr
    May 26 '20 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.