2
$\begingroup$

Ok, let's say I create a 1x1 pixel image.

i = Image[{{0}}, "Byte"];

Now I Export["image.png", i] the image and import it into Libreoffice or Inkscape in Windows 7. Then I copy and paste the image back into Mathematica 8.0.1 and calculate the ImageDimensions.

ImageDimensions[x = Rasterize[<image>]]

I would expect to receive the 1x1 but instead I get {13, 17} because of appended white borders around the image.

Now If I save the copied output form LibreOffice and Inkscape and then Import the file into Mathematica, I run into no problems.

What file formats have issues with Mathematica so I can consistently paste from the clipboard? I know Mathematica has multiple ways to copy files MetaFile and Bitmap under Edit->Copy As, but how do these relate to different way to paste objects?

$\endgroup$
6
  • $\begingroup$ Perhaps Rasterize is doing some blurred edges for you? $\endgroup$
    – cormullion
    Commented May 28, 2013 at 19:41
  • 1
    $\begingroup$ On a Mac, copying from the Front End produces an image on the clipboard that depends on the display size in the notebook; you also get artifacts at pixel boundaries. Try Export to a file, and insert the file. $\endgroup$
    – Michael E2
    Commented May 28, 2013 at 21:35
  • 1
    $\begingroup$ @MichaelE2 I wish Exporting the image to a file solved the issue, but I am trying to bring images into Mathematica. Mathematica has issues with importing certain types of image formats from clipboard. I am trying to determine what file types in the clipboard cause mathematica problems. Ultimately there are some applications that I use on a regular that don't an export to file option, but can't work around the issue without diagnosing the issue first. $\endgroup$
    – William
    Commented May 28, 2013 at 22:08
  • $\begingroup$ Being on a Mac, I'm limited in my ability to help. All I could contribute is that in the process described, going Mma -> App -> Mma, the image seems to be modified in the first step. (In the second step, pasting into Mma, I'm using different apps, and I'm not sure that is relevant to your case.) Anyway, I hope someone else can help you. $\endgroup$
    – Michael E2
    Commented May 28, 2013 at 22:13
  • $\begingroup$ Isn't your issue the clipboard? What supports your claim that the issue comes from MMA? $\endgroup$
    – anderstood
    Commented May 27, 2019 at 14:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.