September 4th, 2009 by matthias
On the Agfa snapscan e20:
- Time scanning an A4 page in 600dpi gray, without quality scan: 94s.
- Time scanning an A4 page in 600dpi gray, with quality scan: 94s.
- Also, it was impossible to eye-detect any differences in the scanned test image.
Perhaps a speed and quality difference is there if scanning with lower resolution than the maximum.
Posted in AGFA Snapscan e20, Graphikbearbeitung, SANE, Sprache: Englisch, alle Artikel | No Comments »
September 4th, 2009 by matthias
Scale the image to bigger size; the type of interpolation used (no, linear, cubic, Lanczos3) might affect the result, but the effects are not really heavy and yet to be determined more exactly.
Apply maximum contrast and adjust brightness to your needs
if diagonal borders now have many “stairs” of 1px height, this is what you want.
This procedure shows that a low-resolution grayscale image contains more information than a higher-resolution black-and-white image, as the latter can be constructed from the former. Therefore, master files for archiving documents should better use the grayscale images.
Calculation: one pixel with 256 shades contains the brightness information of a 16×16pixel array of black and white pixels (as each black one can be thought to make the array’s shade one step darker). If borders can be determined by interpolation well enough, a grayscale image contains the information of a black and white image with 16 times higher dpi resolution. Compared to this, it takes 8 bit per pixel, while the equivalent black and white image takes 256 bits for the same area (256 black and white pixel), so has 32 times higher file size.
Posted in Graphikbearbeitung, Sprache: Englisch, alle Artikel | No Comments »
September 4th, 2009 by matthias
The goal is here: the better the image is to the 300dpi image conversion of an imagined PDF file of the scanned book, the better. That is: white being kist every pixel white, the same with single-color areas, fonts should have anti-aliasing, no JPG compression of letters etc.. Whatever brings the file nearer to that goal goes into the “master files”, all other steps the lead to information loss relative to the above goal goes in additional files.
You don’t have to record how you’ve created the master files, and creating these can also include manual, file-specific steps. But it’s a good idea to have all work based on the master files (like scaling, JPG conversion, PDF creation) done by scripts. As this will be repeated with various settings, while the master files won’t be recreated. This interface definition also allows to re-create derived works after you’ve done some further fine-tuning to the master files. This procedure makes it possible to start with a quick&dirty solution (relatively rough master files), and incrementally add to this, as time permits.
- Print and cut out two stripes of thick paper and tape them to the scanner, to use as horizontal and vertical end stops for designating the origin (0,0) on the scanner glas.
- Define the scanner window to be the exact page size, or double page size for A5 books, which makes automated page extraction from the files possible.
- DIN A5 page at 600 dpi: 3507×4960px
- DIN A4 page or 2 DIN A5 pages at 600dpi: 4960×7015px, 210×297mm
- Find the devicename:
scanimage -L
- scan:
scanimage \
--device-name=snapscan:libusb:001:012 \
--format=tiff \
--high-quality=yes \
--resolution 600dpi \
--mode Color \
-t 0 -l 0 -x 210 -y 297 \
--batch=%02d.tif --batch-prompt --batch-start 1
(This command applied both to A4 and A5, for A5 we’ll partition the images lateron.)
- Remove halftone rasters, by applying Gaussian blur, but only to the parts that actually consist of images, and saving the images as PNG (compression level 2).
- Automatic page extraction from the files. This is necessary if you scanned two A5 pages at once on a A4 sheet. (However, the scanimage command could be changed for this, also).
- separating pages into files:
for file in *.png ; do
convert -crop 2480x1754+0+0 $file ${file/.png/.1.png};
convert -crop 2480x1754+0+1754 $file ${file/.png/.2.png};
done;
Note that the GIMP preview and view for the PNG images created with the second command will be empty, but that’s a GIMP problem as kuickshow shows the images correctly.
- rotating the pages (90° right, if in landscape format):
for file in *.png ; do
mv $file ${file/.png/.orig.png};
convert -rotate "90>" ${file/.png/.orig.png} $file;
done;
- adjust brightness and contrast for white and black to become white and black (this will reduce file size dramatically)
- scale to 300dpi
- save as PNGs with maximum compression level (9 in GIMP,
-quality 105 for ImageMagick)
- the above PNG files are the master files you archive (therefore we use lossless compression); you can now add further optimizations to copies of them, for specific presentation variants (PDF for scree or print usage, e.g.)
- optimization for small file size, near-optimal printing and optimal screen reading
- in areas with text and few-color drawings, get the colors reduced by image processing, to reduce file size
- save as PNG with 16 or 32 colors (optimized palette) for pages where you have few colors (i.e. just the text and drawings, no photos)
- delete fuzzy borders:
convert -page A4 -density 28x28 \
-border 100x100 -bordercolor white page.*.sw.png buch.pdf
- for low-quality originals (e.g. inkjet printouts), screen readability is better when it’s greyscale instead of black and white, and to compensate for bigger file size, less resolution. Printability is, of course, better in black and white mode in higher resolution, but this can be constructed from the grayscale mode by scaling and applying a threshold. Therefore, the master images should be grayscale in these cases.
- PNG file size of grayscale scans can be reduced by 90% by applying higher contrast, so that letters become mostly black and paper mostly white. Contrast should be around 80-90 (of 128), so thet gray pixels still preserve the antialiasing information.
- PNG File size for 300dpi grayscale A4 text page scans (without images) is approx. 4.5 MiB before all optimizations, and 0.9 MiB after applying high contrast. This is acceptable for master files, and gives a very good basis for optimizing in various directions, as much information is contained.
- So the best settings to scan low-quality black and white originals are: 300dpi grayscale, no high-quality scanning. This is both time-efficient and includes all the information that is there to be captured.
- conversion to PDF
for file in *.png; do convert $file ${file/.png/.pdf}; done;
pdftk page.*.pdf cat output book.pdf;
Posted in Gimp, Graphikbearbeitung, ImageMagick, Sprache: Englisch, alle Artikel | No Comments »
September 4th, 2009 by matthias
Enter the dpi setting as an option to convert, like this:
convert -density 97x97 *.jpg file.pdf
Posted in Graphikbearbeitung, ImageMagick, Sprache: Englisch, alle Artikel | No Comments »
September 4th, 2009 by matthias
for file in Seite\ *;
do convert -density 97x97 "$file" "${file/.jpg/.97x97.jpg}";
done;
Posted in Graphikbearbeitung, ImageMagick, Sprache: Englisch, alle Artikel | No Comments »
August 1st, 2008 by matthias
If you have a PDF which you want to modify (and can’t get hold of the source format file), you might have tried scribus to open and change it. This works well for some simple cases, but there are many import errors for more complex files. Also, the same might happen with Inkscape if you have managed to convert the file to SVG format, e.g. using CorelDraw on a Windows virtual machine.
What’s always possible is to import the file in GIMP (“File -> Open”), using a high resolution such as 300dpi. But you might want to avoid the big file sizes and loss in quality, and want to do it vector-oriented.
Therefore, the following solution should work out:
- Convert a low resolution raster image version of the PDF file, e.g. by opening in GIMP (with 150dpi) and saving in JPG format.
- Create a OpenOffice.org Draw drawing with the same page size as your PDF file, and place the raster image file into the background.
- Now that you have the placement of things, change the appearance by adding other elements on top your background. You might want to get some vector oriented elements out of the PDF file by importing the file in scribus and saving as SVG or EPS file, importing that in OOo Draw.
- Export the OOo file to PDF, temporarily removing your background for that. The good thing is that all OOo Draw elements get high-quality vecor oriented PDF elements.
- Add your new PDF file on top of the original one, by saying something like:
pdftk in.pdf stamp overlay.pdf output out.pdf;
As the original vector elements are never converted from PDF to another format and back, no import / export bugs can come in the way!
Posted in DTP, Graphikbearbeitung, OpenOffice, Sprache: Englisch, alle Artikel | No Comments »
May 8th, 2008 by matthias
Auf www.warpgear.com/pantone/index.php?hex=%23555544&red=85&green=85&blue=68&mincolors=3 wurden eine Zeit lang Farbkonvertierungen angeboten, das musste jedoch aus lizenzrechtlichen Gründen eingestellt werden. Damit gibt es anscheinend keine Möglichkeit, PANTONE-Farbwerte in andere Farbmodelle zu übersetzen als über die Verwendung von gekauften PANTONE-Produkten.
Es gibt zwar eine Software »myPANTONE palettes« zum kostenlosen Download auf pantone.com (nach Registrierung), jedoch enthält diese nicht die Pantone Farben (Pantone Goe, Pantone Matching System, …). Diese müssen als »Libraries« zugekauft werden: www.pantone.com/pages/MYP_myPantone/mypPurchaseSoftware.aspx .
Es gibt jedoch die Möglichkeit, PANTONE-Farben in RGB-Werte zu wandeln, über »find a PANTONE color« auf www.pantone.com/pages/pantone/colorfinder.aspx . Diese Umwandlung ist natürlich ungenau, weil die meisten PANTONE-Werte nur angenähert in RGB dargestellt werden können (dasselbe ilt auch für ORACAL-Farben).
Jedoch sollte die Genauigkeit ausreichen um die richtige der max. 200 ORACAL-Farben zu treffen; damit ist die Konvertierung über RGB als Zwischenschritt ein gangbarer (und der einzige ohne Kosten mögliche) Weg.
Verfahren:
- Samples der gesuchten PANTONE-Farben über »find a PANTONE color« auf www.pantone.com/pages/pantone/colorfinder.aspx anzeigen lassen und mit einem Bildbearbeitungsprogramm abspeichern (als Farbfläche von 46×46 px).
- Den ORACAL Color Chart von signofclass.com/oracal_641_color_chart.htm in einem Browserfenster schmal skalieren, neben der Darstellung des PANTONE-Samples plazieren und durch scrollen und Vergleichen die richtige Farbe finden.
- Prüfen ob die gewünschte Farbe in der verwendeten ORACAL Folienfamilie auch enthalten ist. Das geht über folgende Links zu Farbtabellen für einzelne Familien, die jedoch nicht wie die zuvor erwähnte farblich sortiert und auch nicht in einer Spalte zum einfachen Scrollen angeordnet sind
http://www.oracal.com/products/all-colors.asp?seriesID=215 (ORACAL 851 Premium Cast)
www.oracal.com/products/all-colors.asp?seriesID=202 (ORACAL 751 High Performance Cast)
www.oracal.com/products/all-colors.asp?seriesID=184 (ORACAL 651 Intermediate Cal)
www.oracal.com/products/all-colors.asp?seriesID=220 (ORACAL 541 Performance Cal)
www.oracal.com/products/all-colors.asp?seriesID=218 (ORACAL 641 Economy Cal)
www.oracal.com/products/all-colors.asp?seriesID=182 (ORACAL 631 Exhibition Cal)
www.oracal.com/products/all-colors.asp?seriesID=183 (ORACAL 341 Promotion Cal)
www.oracal.com/products/all-colors.asp?seriesID=169 (ORACAL 8500 Translucent High Performance)
? (ORACAL 8100 Translucent Intermediate Cal)
www.oracal.com/products/all-colors.asp?seriesID=201 (ORACAL 8300 Transparent Cal)
Außerdem müssen hier noch eingefügt werden: die Farben der »Reflective Films« und »Specialty Films«.
Weitere Informationen:
- es ist fraglich ob die Genauigkeit des hier beschriebenen Verfahrens gesteigert werden kann wenn man statt einer RGB-Darstellung der ORACAL-Farbe eine ORACAL Farbfolienkarte verwendet. Vermutlich senkt das sogar die Genauigkeit weil die RGB-Darstellung ähnlicher Farben ähnliche Fehler enthält und damit der Unterschied zwischen korrespondierenden PANTONE- und ORACAL-Farbe in RGB geringer ist als wenn eine der beiden physisch (mit Farbkarte) dargestellt wird.
- http://en.wikipedia.org/wiki/Pantone
- http://en.wikipedia.org/wiki/Spot_color
- http://www.indfinspec.demon.co.uk/ral_colour_chart.htm
- http://www.signsofdixie.com/oracal851.html (Farbtabelle)
- http://web.forret.com/tools/color.asp bietet Farbkonvertierungen, jedoch keine bzgl. PANTONE
- ORACAL-Farben werden vollständig durch die Seriennummer der Folie (z.B. 851, 751) gefolgt von der Farbnummer angebeben, z.B. 851-40.
Posted in Graphikbearbeitung | No Comments »
May 8th, 2008 by matthias
Zum Beispiel bei PANTONE: PANTONE-Farben (i.S.v. Tintenformel) mit derselben Nummer sind dieselben, werden aber auf unterschiedlichen Materialien gedruckt und hinterlassen dort jeweils einen unterschiedlichen Eindruck (deshalb U für den Farbeindruck auf unbeschichtetem Papier (uncoated), C für coated, M für matte coated). Siehe pantone.custhelp.com/cgi-bin/pantone.cfg/php/enduser/std_adp.php?p_faqid=85 .
Posted in Graphikbearbeitung | No Comments »
May 8th, 2008 by matthias
Das ist zum Beispiel notwendig um vor der Erzeugung eines Digital Facsimiles mit eingescannte störende Elemente in den Randbereichen zu eliminieren, etwa schwarzer Scannerdeckel-Hintergrund, Heftklammern, Spiralbindung usw..
Verfahren: man bestimmt in GIMP die Größe dieser Bereiche und führt dann etwa aus (hier bei einem Bild der Größe
1654×2338 Pixel, das ist A4 mit 200dpi):
-
for file in page.[0-9]*.tif ;
-
do convert -fill white \
-
-draw ‘rectangle 0,0 1653,50′ \
-
-draw ‘rectangle 0,2288 1653,2337′ \
-
-draw ‘rectangle 0,0 125,2337′ \
-
-draw ‘rectangle 1530,0 1653,2337′ \
-
$file ${file/.tif/.cleaned.tif} ;
-
done
Die Koordinaten müssen dabei so gewählt werden dass zu jedem Rechteck die linke obere und die rechte untere Ecke angegeben werden.
Beispiel mit Trennung / Spiegelung in rechte und linke Seiten:
-
# rechte Seiten:
-
for file in *Blatt[0-9][0-9].jpg ;
-
do convert -fill white \
-
-draw ‘rectangle 0,0 1653,180′ \
-
-draw ‘rectangle 0,2196 1653,2337′ \
-
-draw ‘rectangle 0,0 100,2337′ \
-
-draw ‘rectangle 1485,0 1653,2337′ \
-
$file ${file/.jpg/.cleaned.jpg} ;
-
done
-
# linke Seiten:
-
for file in *Blatt[0-9][0-9].jpg ;
-
do convert -fill white \
-
-draw ‘rectangle 0,0 1653,180′ \
-
-draw ‘rectangle 0,2196 1653,2337′ \
-
-draw ‘rectangle 0,0 169,2337′ \
-
-draw ‘rectangle 1554,0 1653,2337′ \
-
$file ${file/.jpg/.cleaned.jpg} ;
-
done
Posted in Graphikbearbeitung, Shellscripts | No Comments »