Showing posts with label imagemagick. Show all posts
Showing posts with label imagemagick. Show all posts

Wednesday, July 06, 2016

Ruby : Rake Aborted : RMagick was Configured with ImageMagick of Different Version

when running rake on an existing ROR application, on my newly updated linux box, rake gets aborted and says RMagick was configured with ImageMagick of an old version but a new version is in use.


i thought of downgrading  my ImageMagick to make it work, but the version difference was more than one release. then i thought of downgrading to that specific ImageMagick version. but what if i need the latest version for other applications?

turns out, you can just reinstall the RMagick gem to have it configured to your current ImageMagick version. no more problemo :)

Wednesday, May 21, 2014

fedora: scan image to text

so... i had a need to convert hard copy of statements sent by slow mail to flat digital text files. i need them in digital form so i can do comparison with another transmitted digital data. and the procedure below works best for me, so far (you'll need imagemagick and tesseract installed):

1. scan hard copy of statement using the largest resolution
2. save as jpeg image file format
3. convert jpeg file to tif using imagemagick
# convert sample_doc.jpg sample_doc.tif
4. do optical character recognition - ocr using tesseract
# tesseract sample_doc.tif sample_doc
5. manually verify ocr output

here's a sample of the scanned image and its digital text file output. compare rightmost values. (i had to censor some details which were accurately converted by tesseract hahaha)


need met ;)

i remember having a pdf-to-text function before but pdftotext of xpdf didn't work with my scanned image file. also, i had problems using lower resolution scanned images.

conversion of jpeg to tif in step 3 is needed because tesseract works with tif files.

Thursday, April 10, 2014

linux: image reduce size via imagemagick

to quickly reduce image file size, on a linux box, using ImageMagick

/usr/local/bin/convert -quality <quality rate> <source file> <destination file>

ex: /usr/local/bin/convert -quality 81 20140207_090514N.jpg 20140207_090514N.jpg

you can adjust quality rate as needed.

i'm sure this will work on windows' ImageMagick too ;)

Wednesday, November 13, 2013

linux: image orient via imagemagick

to do image rotation based on orientation, on a linux box, using ImageMagick

auto rotate images based on exif orientation values:
/usr/local/bin/convert -auto-orient <source file> <destination file>

yep, that's it.

Thursday, January 24, 2013

linux: image resize via imagemagick

download and compile ImageMagick from source ImageMagick.tar.gz

to retain exif just resize:
/usr/local/bin/convert -resize 1024 <source file> <destination file>

to create a lighter file, create thumbnail:
/usr/local/bin/convert -thumbnail 200 <source file> <destination file>

;)

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...