Search found 10733 matches

by snibgo
2018-10-22T18:45:07-07:00
Forum: Users
Topic: Convert pdf if has less than 2 pages Command line
Replies: 4
Views: 64

Re: Convert pdf if has less than 2 pages Command line

You can put "rem" inside loops, but not "::".

As you are learning the basics of BAT scripting, I suggest you find a good manual or webpage on the subject.
by snibgo
2018-10-22T17:03:56-07:00
Forum: Users
Topic: Trim/crop by alpha
Replies: 12
Views: 123

Re: Trim/crop by alpha

WexOneOne wrote:Delegates (built-in): fontconfig freetype jng jpeg lzma png tiff x xml zlib
This doesn't have OpenEXR, so your IM can't read EXR.

I suggest you install OpenEXR, then rebuild IM.

My corrected command (see my edit above) gives:
Image
by snibgo
2018-10-22T16:19:48-07:00
Forum: Users
Topic: Trim/crop by alpha
Replies: 12
Views: 123

Re: Trim/crop by alpha

Does "magick" work at all? How about:

Code: Select all

magick -version
magick rose: x.png
magick x.png x.jpg
If those don't work, you need to reinstall IM and/or delegates.

If they do work, can you read EXR files?

Code: Select all

magick in.exr NULL:
by snibgo
2018-10-22T15:30:36-07:00
Forum: Users
Topic: Trim/crop by alpha
Replies: 12
Views: 123

Re: Trim/crop by alpha

I've re-read what you asked for, and perhaps I misunderstand. How about:

Code: Select all

magick in.exr -trim +repage -gravity center -bordercolor none -border 10 out.png
Does that do what you want?

EDIT: corrected to "+repage" instead of "-repage".
by snibgo
2018-10-22T14:33:14-07:00
Forum: Users
Topic: Trim/crop by alpha
Replies: 12
Views: 123

Re: Trim/crop by alpha

What version of IM on what platform? Extract the alpha to a grayscale image, then "-format %@" gives you what the trim dimensions would be. Read these into a script and do whatever adjustment you want, and use that in a "-crop". Or it can be done in a single v7 command. Or even v6, but that is messy.
by snibgo
2018-10-22T12:34:50-07:00
Forum: Users
Topic: Convert pdf if has less than 2 pages Command line
Replies: 4
Views: 64

Re: Convert pdf if has less than 2 pages Command line

Your line...

Code: Select all

echo %pgs%
... should be ...

Code: Select all

echo !pgs!
... and you should check you have enableddelayedexpansion.

Your ...

Code: Select all

-format %n 
... should be ...

Code: Select all

-format %%n 
by snibgo
2018-10-22T06:21:42-07:00
Forum: Magick.NET
Topic: ImageMagick dll and Exe returns two different values for RMSE image comparison
Replies: 2
Views: 46

Re: ImageMagick dll and Exe returns two different values for RMSE image comparison

What values are you getting from the two methods?

If you post links to your inputs, we can use other methods to nail down the difference.
by snibgo
2018-10-22T02:39:20-07:00
Forum: Users
Topic: Remapping a picture to a set color palette.
Replies: 3
Views: 70

Re: Remapping a picture to a set color palette.

The data loss (ie change to pixels) occurs when writing JPG, not reading JPG. If your source image is JPG, converting it to PNG won't get the data back. As general rules: don't use JPG sources unless nothing better is available. Don't use JPG for any image processing. JPG is a useful format if you w...
by snibgo
2018-10-21T13:57:53-07:00
Forum: Users
Topic: Confused about median
Replies: 6
Views: 114

Re: Confused about median

Something else to remember: "-statistic" is affected by the "-virtual-pixel" setting.
by snibgo
2018-10-21T12:12:39-07:00
Forum: Users
Topic: Change picture to transparent and inserting it into other picture at specific location
Replies: 19
Views: 527

Re: Change picture to transparent and inserting it into other picture at specific location

When you composite two images, metadata for the result is taken from the first input, not the second. 4060715278916-0.png may contain critical metadata. Perhaps reversing the order will do what you want.

The links to your images are broken, and I can't download them.
by snibgo
2018-10-21T05:50:55-07:00
Forum: Users
Topic: Remapping a picture to a set color palette.
Replies: 3
Views: 70

Re: Remapping a picture to a set color palette.

You are saving to JPG format. JPG is lossy, which means it changes the pixel colours. I suggest you use a losslesss format such as PNG.
by snibgo
2018-10-20T15:55:24-07:00
Forum: Users
Topic: Unwanted gaps between combined PNG images
Replies: 30
Views: 982

Re: Unwanted gaps between combined PNG images

I have not located a photo service website ... So, don't use a photo service website. Find somewhere to upload files . 1.) I save my plots into EPS files and convert (ImageMagick command) them to JPEGs, ... Please show use the exact commands you use, and sample EPS files that have this problem. Per...
by snibgo
2018-10-20T11:24:37-07:00
Forum: Users
Topic: Get coordinates Top, Left, size of some areas
Replies: 46
Views: 822

Re: Get coordinates Top, Left, size of some areas

I had overlooked Fred's previous example showing multiple "-k" entries. This is how we can sort by field 3 (y) then field 2 (x), and this is cleaner than calling sort twice, so my script now has:

Code: Select all

 null: | awk 'NR>2 {print $2}' | sort -g -t "+" -k 3 -k 2`)
... and this works fine.
by snibgo
2018-10-20T04:43:21-07:00
Forum: Users
Topic: Get coordinates Top, Left, size of some areas
Replies: 46
Views: 822

Re: Get coordinates Top, Left, size of some areas

Running Fred's script on Cygwin bash on Windows 8.1, I get the same results as cgkas, not Fred. The problem is in the sort, "-k 3,2". Sort with "--debug" says it can't find the key in any record. "sort --help" says: -k, --key=KEYDEF KEYDEF is F[.C][OPTS][,F[.C][OPTS]] for start and stop position, wh...
by snibgo
2018-10-19T16:30:11-07:00
Forum: Users
Topic: Unwanted gaps between combined PNG images
Replies: 30
Views: 982

Re: Unwanted gaps between combined PNG images

xinmude wrote:... the resulting PNG is larger, sometimes by nearly 50%, than its JPG counterpart.
For some images, PNG gives better compression than JPG. For others, JPG is better.

But if you are getting added borders around appended PNGs, something is wrong.