![]() If the resolution isn't to your liking, adjust it using something like -density 150. The scale option is probably the most useful step for reducing the size of most figures, but there is also a compress option whose default setting can be changed if necessary. To create bitmaps, use the convert utility, e.g., convert -scale 50% file.pdf file.jpg. In addition to a graphical user interface, it also offers all of its functionality via the command line in the Terminal. The platform on which I usually do this is Mac OS X, but much of the following (in particular the command-line tools) is done the same way under Linux.Ĭonversion of vector graphics like PDF to bitmap format can be achieved with the ImageMagick software. On this page, I'll assume we have a PDF or Postscript figure whose file size needs to be reduced. In Illustrator, to get small figures for arXiv or for your own web site, the final step is to choose Export for Web in Illustrator, and create a jpeg, gif or png file. My strategy for creating figures almost always involves going through Adobe Illustrator - this is the reason why this page was originally created. Check the arXiv help for how to enable pdflatex on their system (all that's needed is an explicit \pdfoutput=1 statement). Although I do cover EPS creation below, it is now essentially an obsolete format. What this means is that you won't have to convert figures to EPS any more, in order to make them compatible with latex. Regarding arXiv, the good news is that pdflatex is meanwhile fully supported. In this case, you'll want your figures in PDF, PNG or JPEG format. In the TeX world, it is by now standard to produce PDF output, usually with pdflatex. This database operates under strictly enforced policies regarding the size of submissions, and they also give some advice on how to keep the size of figures small. ![]() One important case in point is the arXiv preprint archive. See above for how to override this behaviour.Reducing the size of vector and bitmap imagesĪlthough memory is cheap nowadays, there are still situations where you have to watch the size of your scientific illustrations very carefully. ![]() If the reported size is different from what was requested then that is probably because one of the dimensions was reduced in order to preserve the aspect ratio. The third field of the output is the size in pixels: output.png PNG 240x192 240x192+0+0 DirectClass 16-bit 100.373kb You can check that the result is of the expected size using the identify command, which is also part of ImageMagick: The method described here is not limited to PNG-format images: a large number of other formats are supported, including BMP, GIF, JPEG, PNM and TIFF. See the ImageMagick documentation for further details. There are several other ways in which the output size can be specified, for example as a percentage. Since this is a shell metacharacter it must be escaped:Ĭonvert input.png -resize 240x192\! output.png If you do not want this to happen, and are prepared to accept the resulting distortion, then you can allow the aspect ratio to change by appending an exclamation mark to the required size. This is done by reducing either the width or the height of the output by an appropriate amount. Resizing is performed using the -resize operator, which can be invoked as an argument to the convert command:Ĭonvert input.png -resize 240x192 output.pngīy default the aspect ratio of the image is preserved. On Debian-based systems, the command-line interface to ImageMagick is provided by the package imagemagick: The method described here uses ImageMagick to resize the image. You wish to resize it to 240 by 192 pixels, writing the result to the file output.png. Suppose that the file input.png contains a PNG-format image that is 320 by 256 pixels in size. To enlarge or reduce an image using ImageMagick Scenario Ubuntu (Lucid, Maverick, Natty, Precise, Trusty)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |