Mathematica allows one to work with the information that is behind a photo. For example, the command ImageData generates a list containing the “pixels” (which will it be a number from $0$ to $1$ if no options are added) that are present in the photo.

Although, from a specific photo I could verify that each number is a machine number. But I want to know more than that. I want to know that if, for all photos, those numbers will be machine numbers.

I trie dot search at Wolfram website but didn’t find anything about that. So can someone tell me if the pixels in a photo will be machine numbers?

Thank you for your attention!

  • 3
    $\begingroup$ It says in the docs: ImageData[image,Automatic] is equivalent to ImageData[image,ImageType[image]] so if your image is a "Bit" image (black and white) it may not necessarially be a machine number but integers 0 or 1. $\endgroup$
    – flinty
    May 29, 2021 at 14:30
  • $\begingroup$ Oh I see! I was just checking that right now. But if i choose “Real32” or “Real64” I will get machine numbers for sure, right? I checked with “Byte” and “Bit16” and I got intergers $\endgroup$
    – Air Mike
    May 29, 2021 at 14:34
  • $\begingroup$ Yes try ImageData[Binarize[RandomImage[]], "Real64"][[1, 1]] // MachineNumberQ - even though the Binarize[RandomImage[]] is a "Bit" image, the ImageData with "Real32" or "Real64" gives you a machine-number image. $\endgroup$
    – flinty
    May 30, 2021 at 14:12
  • $\begingroup$ ImageData can return data of different types. However, with ImageAdjust` you can convert all data to real valued data in the range 0..1 $\endgroup$ May 30, 2021 at 18:46


Browse other questions tagged or ask your own question.