Search found 23 matches

by Masejoer
2016-08-09T11:58:19-07:00
Forum: Magick.NET
Topic: How to convert these IM commands to Magick.NET?
Replies: 1
Views: 13578

How to convert these IM commands to Magick.NET?

I have two Shell-script convert.exe commands I'm trying to convert over to use the .NET library. Can anyone provide guidance here? First, I'm trying to remove the backdrop (trim doesn't work as well as this script does). Part of shell-script: var=`convert ./input.jpg -blur 0x4 -threshold 45% -format...
by Masejoer
2016-08-09T11:29:56-07:00
Forum: Users
Topic: Getting correct image width and height
Replies: 5
Views: 4824

Re: Getting correct image width and height

fmw42 wrote:Also how did you determine the heights? What IM command?

Code: Select all

read -r WW HH <<< $( convert ./input.jpg -format "%w %h" info:) `#Get width and height of image` 
by Masejoer
2016-08-09T11:28:04-07:00
Forum: Users
Topic: Getting correct image width and height
Replies: 5
Views: 4824

Re: Getting correct image width and height

I've noticed that the same image on Windows 7, Windows 10, and Ubuntu reports different widths and heights. Please supply an example file that has this problem. Got a new photo. I had to get one without identifying information. This was taken with an iPhone. It shows different orientation in differ...
by Masejoer
2016-08-03T12:40:08-07:00
Forum: Users
Topic: Deskew - remove added pixels
Replies: 7
Views: 5203

Re: Deskew - remove added pixels

Does anyone know the real difference between "-deskew 40%" and "-deskew 40"? Some images deskew perfect with 40%, while others only deskew with "40". "40%" will just fail to deskew if it can't get a straight line, "40" will simply rotate the image a ...
by Masejoer
2016-08-03T09:53:53-07:00
Forum: Users
Topic: Getting correct image width and height
Replies: 5
Views: 4824

Getting correct image width and height

Another topic - I'm having issues getting consistent width and height values using "convert -format". I've noticed that the same image on Windows 7, Windows 10, and Ubuntu reports different widths and heights. One environment may report portrait dimensions while another reports landscape d...
by Masejoer
2016-08-03T09:28:06-07:00
Forum: Users
Topic: Deskew - remove added pixels
Replies: 7
Views: 5203

Re: Deskew - remove added pixels

From my experience -deskew does not work well for angle above about 5% and probably not well also if the sides are not straight I've had great luck running the deskew to get the images straight, and extremely angles (40 degrees) if I deskew twice. I just can't get good consistent cropping from the ...
by Masejoer
2016-08-02T12:20:55-07:00
Forum: Users
Topic: Deskew - remove added pixels
Replies: 7
Views: 5203

Re: Deskew - remove added pixels

I'm running ImageMagick-7.0.1-6 Q16-x64 on Windows (.bat) and 7.0.2-5 Q16-x64 on Ubuntu (.sh). Every time I try deskew xx% in Ubuntu, it fails to do anything, so I've been using the value without percent symbol. Maybe another bug. Thanks for the bug report, fmw42. Current image: http://www.masejoer....
by Masejoer
2016-08-01T15:10:04-07:00
Forum: Users
Topic: Deskew - remove added pixels
Replies: 7
Views: 5203

Deskew - remove added pixels

The handful of forum results don't help with this issue. I have an image that is being de-skewed by about 5%. This rotates the image and leaves solid colors where data didn't exist. I cannot seem to get auto-crop to work, at all. convert input -background black -set option:deskew:auto-crop 1 -deskew...
by Masejoer
2016-07-27T08:57:52-07:00
Forum: Users
Topic: Removing saturated blocks of rows under pixel height
Replies: 2
Views: 2924

Re: Removing saturated blocks of rows under pixel height

EDIT: As always, there are alternatives. Here's a faster and more obvious replacement for that middle step: %IM%convert x.png -morphology close rectangle:1x30 -scale "232x216^!" x2.png Yeah, I tried this last night and found the following to work well across multiple samples: convert inpu...
by Masejoer
2016-07-26T14:14:53-07:00
Forum: Users
Topic: Whiting out or trimming rows that have less than % of pixel color
Replies: 6
Views: 4707

Re: Whiting out or trimming rows that have less than % of pixel color

for /F "usebackq" %%L in (`%IM%identify ^ -format "WW=%%w\nHH=%%h" \n check_bw.jpg`) do set %%L %IM%convert ^ check_bw.jpg ^ ( +clone ^ -scale "1x^!" ^ -fuzz 15%% ^ +transparent White ^ -fill White -colorize 100 ^ -scale "%WW%x^!" ^ ) ^ -compose Over -composi...
by Masejoer
2016-07-26T14:10:33-07:00
Forum: Users
Topic: Removing saturated blocks of rows under pixel height
Replies: 2
Views: 2924

Removing saturated blocks of rows under pixel height

I assume ImageMagick can do this, but I have no leads in where to start. I have this sample image: http://masejoer.com/Images/IM/image_step9.jpg I want to keep only the digits in the center of the image. Is there a way in IM, without writing things out to file, to remove the black bars at the top an...
by Masejoer
2016-07-14T17:31:37-07:00
Forum: Users
Topic: Whiting out or trimming rows that have less than % of pixel color
Replies: 6
Views: 4707

Re: Whiting out or trimming rows that have less than % of pixel color

Write your scaled image to txt: format. Did this already. It sped it up quite a bit. :D See h ttp://www.imagemagick.org/Usage/files/#txt. Then you can write a loop to find all rows (or columns depending upon your scaling) that pass your test by parsing for the color/grayscale. Then from the list of...
by Masejoer
2016-07-14T17:05:43-07:00
Forum: Users
Topic: Whiting out or trimming rows that have less than % of pixel color
Replies: 6
Views: 4707

Re: Whiting out or trimming rows that have less than % of pixel color

Scale it to a single column. The values in the resulting pixels are the percentage of pixels that are white. You can ready those values and do the decision-making in a script. Tried this. Need to find a more efficient way to handle it than I currently am. I scaled to a 1x161 pixel high image. It ta...
by Masejoer
2016-07-14T13:50:17-07:00
Forum: Users
Topic: Whiting out or trimming rows that have less than % of pixel color
Replies: 6
Views: 4707

Whiting out or trimming rows that have less than % of pixel color

I am continuing work on OCR pre-processing. I was wondering if there is a way for ImageMagick to white out all pixels in a row that do not have at least x% of a color. Does anyone know of such a capability? Example image: http://masejoer.com/Images/IM/check_bw.jpg I would like rows with less than ro...
by Masejoer
2016-07-01T16:09:13-07:00
Forum: Users
Topic: Trimming and cleaning up large number of photographed checks
Replies: 16
Views: 9846

Re: Trimming and cleaning up large number of photographed checks

convert c:pictures\palette.png ( +clone -colorspace HCL -channel G -separate +channel -auto-level -threshold 40% +write x.png ) -compose Lighten -composite grey_pal.png This is my result, with v6.9.2-5: http://snibgo.com/imforums/grey_pal.png Lower the threshold, eg to 10%, to turn more colours to ...