22 01 | 2016

Removing sam2p from Debian

Written by Tanguy

Classified in : Homepage, Debian, Command line, To remember

Issues with sam2p and removal

I have been maintaining the Debian package of sam2p for some time. Unfortunately, the upstream development of that program is no longer active, and it is using an old custom build chain that no longer works with recent version of GCC.

This package is currently failing to build from source, and while I have been able to patch some issues in the past, and it may still be possible to fix it again, this is not really sustainable.

I am therefore considering to remove sam2p from Debian, unless someone has a very good reason to keep it and is able and willing to maintain it.

Alternative

sam2p is a raster image conversion tool that can convert PNG and JPEG to EPS and PDF while keeping their compression, which is mostly useful to use them in documents compiled with LaTeX. Fortunately, the same can be done with ImageMagick. If you want to convert to EPS, you have to specify that you want EPS 2 or 3, otherwise it would produce EPS level 1 which does not provide native raster compression:

% convert debian-openlogo-raster100.png \
          eps3:debian-openlogo-raster100.eps
% convert debian-openlogo-raster100.png \
          debian-openlogo-raster100.pdf
% ls -lh
1.7K debian-openlogo-raster100.png
6.0K debian-openlogo-raster100.eps
8.8K debian-openlogo-raster100.pdf

% convert photograph.jpg eps3:photograph.eps
% convert photograph.jpg photograph.pdf
% ls -lh
657K photograph.jpg
662K photograph.eps
664K photograph.pdf

% convert scanned-document.png eps3:scanned-document.eps
% convert scanned-document.png scanned-document.pdf
140K scanned-document.png
145K scanned-document.eps
150K scanned-document.pdf

This is a bit less efficient than sam2p, as convert seems to add some fixed overhead, but it does keep the appropriate compression algorithm. See this documentation page from ImageMagick for more information.

Using appropriate formats

As a reminder, when writing LaTeX documents, depending on your build chain, you can use:

photographs
JPEG or EPS (converted from JPEG with ImageMagick);
raster drawings, screenshots…
PNG or EPS (converted from PNG with ImageMagick);
vector graphics
PDF or EPS (convertes from SVG with Inkscape).

1 comment

friday 22 january 2016 à 01:06 Tanguy said : #1

Note: The scanned-document.png is, well, a scanned paper, after I optimized it to make the background really white, the text really black, and a few colored parts (a logo and some titles) really flats, so it can be compressed best in PNG. That show that the resulting EPS and PDF are really compressed the same way as the PNG, because a JPEG compression would weight significantly more.

Write a comment

What is the third letter of the word fxqkc? : 

Archives