Showing posts with label graphics. Show all posts
Showing posts with label graphics. Show all posts

Saturday, 3 May 2014

Image::Magick with Perlbrew.

Image::Magick is great, but it's a pain to install if you are using perlbrew, or if your system's Image Magick library is out of date. After some googling I found that this was the best technique, but cpanm support is missing, making using Image::Magick very difficult to include in your application's dependencies.

So I wrote a perlbrew + cpanm compatible Image::Magick perl package.

Note that it still depends on your perl to be build to generate the shared library libperl.so. So give it a go and if your perl is not compatible, it should tell you what to do:

cpanm -v Alien::ImageMagick

Then use Image::Magick as usual. Your application will have to depend on Alien::ImageMagick, not Image::Magick.

Happy coding!

Wednesday, 24 August 2011

LaTeX: Included graphics resolution

While most graphic files on the internet have a resolution of 72pixel/inch, you need to keep in mind that this resolution is often not suitable for printing. To illustrate that, let's take two images that have the same number of pixels (348 x 350):
One is set at 72pixels/inch:


And the other one is set at 144pixels/inch:


As you can see here, there's no way to tell the difference between them on the screen because your browser displays these images according to their sizes in pixels, regardless of their resolution.

Now if you write a LaTeX document that includes them both:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{lowres.png}
\includegraphics{highres.png}
\end{document}

Here's what you get as the resulting pdf:


As you can see, the original 72px/in image will appear 'too big', pixelized and blurry on your piece of paper, whereas the 144px/in one will be twice as small and keep its sharpness.

So don't hesitate to experiment with resolution when making LaTeX based documents.

That's all for today!