Search found 17 matches

by bratpit
2019-09-20T08:32:19-07:00
Forum: Users
Topic: Counting Color and Grey Scale in a directory?
Replies: 19
Views: 31568

Re: Counting Color and Grey Scale in a directory?

Just simple as previous.

Code: Select all

for i in *.pdf;do pdfimages -list "$i"|grep gray ;done|wc -l
for i in *.pdf;do pdfimages -list "$i"|grep rgb ;done|wc -l
by bratpit
2019-09-19T00:29:43-07:00
Forum: Users
Topic: Counting Color and Grey Scale in a directory?
Replies: 19
Views: 31568

Re: Counting Color and Grey Scale in a directory?

Correct -- Colorspace is Gray and Type is Grayscale. Yes but I am not telling about that. I am telling about comparison two identify outputs for tiff and jpg. logo_gray.jpg JPEG 640x480 640x480+0+0 8-bit Gray 256c 34253B 0.000u 0:00.001 logo_gray.tif TIFF 640x480 640x480+0+0 8-bit Grayscale Gray ...
by bratpit
2019-09-17T11:27:34-07:00
Forum: Users
Topic: Counting Color and Grey Scale in a directory?
Replies: 19
Views: 31568

Re: Counting Color and Grey Scale in a directory?

Yes But this is some inaccuracy in display fields by identify IMHO. Output from tif: convert logo: -colorspace gray logo_gray.tif logo_gray.tif TIFF 640x480 640x480+0+0 8-bit Grayscale Gray 33344B 0.000u 0:00.000 Both tif and jpg have field type:Grayscale from full verbose identify output. So most ...
by bratpit
2019-09-17T11:13:33-07:00
Forum: Users
Topic: Counting Color and Grey Scale in a directory?
Replies: 19
Views: 31568

Re: Counting Color and Grey Scale in a directory?

Yes But this is some inaccuracy in display fields by identify IMHO. Output from tif: convert logo: -colorspace gray logo_gray.tif logo_gray.tif TIFF 640x480 640x480+0+0 8-bit Grayscale Gray 33344B 0.000u 0:00.000 Both tif and jpg have field type:Grayscale from full verbose identify output.
by bratpit
2019-09-17T00:04:27-07:00
Forum: Users
Topic: Counting Color and Grey Scale in a directory?
Replies: 19
Views: 31568

Re: Counting Color and Grey Scale in a directory?

ccameron wrote: 2019-09-16T10:31:02-07:00 Would this still work with .Tif files? I am new to these tools and have not used them before.

Code: Select all

for i in *.jpg;do identify -ping "$i"|grep Grayscale ;done|wc -l
for i in *.tif;do identify -ping "$i"|grep Grayscale ;done|wc -l
by bratpit
2019-09-10T11:07:21-07:00
Forum: Users
Topic: Counting Color and Grey Scale in a directory?
Replies: 19
Views: 31568

Re: Counting Color and Grey Scale in a directory?

for i in *.png;do exiftool "$i"|grep Grayscale ;done|wc -l
by bratpit
2019-06-25T11:36:59-07:00
Forum: Users
Topic: Unable to parallelize pdf -> png conversion
Replies: 4
Views: 8150

Re: Unable to parallelize pdf -> png conversion

Use ghostscript directly . On my Linux machine is about 3 times faster than IM itself. Ghostscript can not multithreading processing one multipage pdf file. But if you have several pdf files You can each pdf file process with single core of processor. I do not know win10 but in linux is pretty ...
by bratpit
2019-05-03T00:15:31-07:00
Forum: Users
Topic: Efficient batch converting
Replies: 2
Views: 4542

Re: Efficient batch converting

Try something like this in your loop:

//get mtime and add to variable
mtime=$(stat -c %y "$file")
//process file
convert "$file"
//after that change mtime
touch -d "$mtime" "$file"
by bratpit
2019-01-15T09:41:44-07:00
Forum: Users
Topic: page count of a pdf file
Replies: 5
Views: 18164

Re: page count of a pdf file

pdfinfo sample.pdf | grep -a Pages | cut -d : -f 2
by bratpit
2018-11-13T10:40:09-07:00
Forum: Users
Topic: Can't convert image file using a bash script
Replies: 20
Views: 21606

Re: Can't convert image file using a bash script

Fortunatelly there is several ways to do the same in bash :-)
by bratpit
2018-11-13T10:30:38-07:00
Forum: Users
Topic: Can't convert image file using a bash script
Replies: 20
Views: 21606

Re: Can't convert image file using a bash script

duplicate prev. post
by bratpit
2018-11-13T10:09:35-07:00
Forum: Users
Topic: Can't convert image file using a bash script
Replies: 20
Views: 21606

Re: Can't convert image file using a bash script

Read what bash telling you. est.sh: line 3: -4: substring expression < 0 this means bash not allow negative values in substring expansion. This works in bash > 4.2. Probably your bash in Cygwin is < 4.2. Check this parametr expansion: ${1%.*}palette.png if not this old-school works in bash, sh, ash ...
by bratpit
2018-10-28T01:57:06-07:00
Forum: Users
Topic: Ideal Hardware
Replies: 1
Views: 4705

Re: Ideal Hardware

Will I gain any performance increases from going from 6.9.7.4 to 7.0.8-14 on the same hardware? Or should I just bite the bullet with a new box, knowing that even if I can't get OpenCL to work, the CPU will have improved performance? Check performance by time command: time convert.......... time ...
by bratpit
2018-10-14T00:47:16-07:00
Forum: Users
Topic: Optimizing Imagemagick convert & composite code
Replies: 14
Views: 42914

Re: Optimizing Imagemagick convert & composite code

That code is for Windows and won't work on Unix. In Unix syntax, try cd directory_containing_wordfile.txt wordlist=`cat wordfile.txt` for word in $wordlist; do convert canvas.jpg \ \( -size 100x100 -background white -font arial.ttf \ -fill black label:"$word" -trim +repage -depth 8 \) \ -gravity ...
by bratpit
2018-09-27T23:54:16-07:00
Forum: Users
Topic: Remove horizontal summation lines but keep a minus
Replies: 28
Views: 24310

Re: Remove horizontal summation lines but keep a minus

@snibgo i was able to formulate the following script for bash. (I feel good to contribute somehow to the topic) #!/bin/bash INPDF=$1 PAGES=$(exiftool -args -PageCount $INPDF | cut -d'=' -f2) N=$(( $PAGES )) for ((I=1;I<=$N;I++)); do convert -density 300 $INPDF[$I] -depth 8 -strip -background white ...