0
$\begingroup$

I pasted an image from the clipboard into a Mathematica notebook. When I try to perform imagedata on it, it says: ImageData::imginv: Expecting an image or graphics instead of {1}.

So how do I make an image an image?

$\endgroup$
  • 5
    $\begingroup$ Pasting into an input cell and using ImageData on it works for me in 11.3 / macOS and has worked in every past version I can remember. You'd need to provide more information so people can understand what you are doing precisely. $\endgroup$ – Szabolcs May 14 '18 at 18:40
  • 1
    $\begingroup$ In your case, it is saying that the input is not an Image or Graphic which begs the question "What is it?". Try running Head[ <picture>] $\endgroup$ – Jason B. May 14 '18 at 18:42
3
$\begingroup$

Pasting your image directly into ImageData[your_image_here] should work. For example, I paste the image of the moon below into ImageData[] and it returns a list of pixel values. What does ImageType[] return when you paste your image into it? Can you upload your image to help others diagnose the problem?

ImageData[Moon]

Pixel Data

$\endgroup$

Your Answer

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

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