I'm using Raster to create large graphics (1000 by 1666), which I want to Export as a JPEG or TIFF in a resolution that can be printed in a large size, 3' by 5'. I'm lost in the maze of options available, and my exported files are always at very low resolution.
|
First, some clarifications:
So, let's suppose you have a 1000 × 1000 pixels image file. What is the resolution of your image? If it is not shown, neither on the screen, nor on paper, it has no resolution (sure your image software can register in a file a specific value for the resolution, but this value has absolutely no impact on your image, see it as something like the date on a digital photograph.) (I'm sure someone from the "printing" business would not agree with some of the words I used, but let's use this as my personal practical definition) If you print that 1000 × 1000 pixels image on a 4" × 4" size paper, it will have a image resolution printing output of 1000/4"= 250 dpi. If you printed with a printer resolution of 2500 × 2500 dpi, then your printer placed 10 × 10 drops of ink to render each pixel of your digital image (this also allows for a correct color rendering from just 3 or 5 different ink recipients). If you display the same 1000 × 1000 image on your screen, with a 100 % zoom (where each pixel of the image occupies exactly one pixel on your screen), most likely, your image will measure 1000/72" (if you use a ruler), since most screens have a resolution of 72 dpi (recent laptops may have substantially higher resolution). So, another important question is: What should be my image resolution printing output? When printing, you should have an image resolution printing output between 150 and 300 dpi. Below 150 dpi, you will start to see the pixels on your printing. Above 300 dpi, only with very precise printers, and looking very closely, will you see a difference to the same image at 300 dpi. For a 3' × 5' print, I think that 200 dpi image resolution printing output is more than enough, since it is probably a print that will be observed from a certain distance. This means you would need 3 × 12 × 200 by 5 × 12 × 200 = 7200 × 12000 pixels on your file. How to generate this on Mathematica? There are a lot of different ways. I will show you a couple of examples:
This places on your screen an image occupying 100 pixels (horizontal) of your screen.
This exports a 100 horizontal pixel size image
This exports a 200 horizontal pixel size image (it changes your original option, defined on the
This is more interesting, and probably what you are looking for: it calculates the length of your image shown on your screen, taking into consideration a 72 dpi screen (don't know if Mathematica checks on you screen specification its exact dpi), and then multiplies the calculated inches, by the So, I recommend that you play around with (See JPEG specifications to get it into a reasonable file size.) |
||||
|
|
The reason for loosing quality is the behavour of default option
For example, let us try to generate a 500x500 texture:
The generated texture must be 500 pixels width but is automatically converted to 360 pixels width with loosing quality:
I say "loosing quality" because we can not get all the points those are computed by
I think that this behavour should be default for Another way is to convert the
Resizing of the notebook results in resizing of the generated image without loosing quality. The resulting texture is exported to PNG without quality loss:
P.S. Thanks Stoney Ballard for his reviews: Exporting Pixel-Perfect Graphics in Mathematica Pixel-perfect Graphics, Revisited Jens-Peer Kuska's solution for Mathematica 5: "Exporting a bitmap in native resolution." EDIT I found simpler way to fix
It is interesting to note that original array of pixels in
These values are clipped when |
||||
|
|
|
The function for exporting data is On a side note,
That's not for (When software like Photoshop offers you to work in meters, you always have to specify the resolution/dpi somewhere, so that internally, the program can work with pixels again, only pretending to know cm in the frontend.) |
|||
|
|


ImageSizeandImageResolution. Do you have a specific example we can play with? – J. M.♦ Jan 19 '12 at 16:54CompressionLevelwhich is particularly important in JPEG.ImageResolutionisn't an option for JPEG, but it is for TIFF. – rcollyer Jan 19 '12 at 16:55Imageinstead ofRaster. This will both be faster and allow you to export the image in a pixel-perfect way. – Szabolcs Jan 19 '12 at 16:58