How to place image directly to the center?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to place image directly to the center?

Post by snibgo »

The white strip on the left is 6 columns wide, not 5. We can shave first, crop and find the mimimum:

Code: Select all

f:\web\im>%IMG7%magick pic0.jpg -shave 2x2 -crop 4x+0+0 -format %[fx:minima*255] info:
0.921569
So the darkest channel value in those remaining 4 columns is 92.15% (which is 235 out of 255), so "-fuzz 2%" won't include it.
snibgo's IM pages: im.snibgo.com
imanasya
Posts: 36
Joined: 2018-10-05T11:21:07-07:00
Authentication code: 1152

Re: How to place image directly to the center?

Post by imanasya »

snibgo, thank you. It was a jpeg artifact. When I created this pic there were no pixels except pure white.
Post Reply