Search found 29 matches

by TomXampp
2020-01-01T00:29:45-07:00
Forum: IMagick
Topic: Seeking equivalent Imagick commands
Replies: 5
Views: 2935

Re: Seeking equivalent Imagick commands

Thanks for that suggestion. When I use the command-line version, at this point in the code a black 100x100 background image (canvas) is created and an 88x88 version of the input image is superimposed in the northwest corner of it. So, that's the goal for the PHP/Imagick routine at this point. If I d...
by TomXampp
2019-12-31T18:05:57-07:00
Forum: IMagick
Topic: Seeking equivalent Imagick commands
Replies: 5
Views: 2935

Re: Seeking equivalent Imagick commands

Thanks for checking it out. It looks like I'm going to have to break the routine into small steps and compare what the command-line version does versus the PHP Imagick version. To begin, I've cut out the bottom part of the routine and simply left this, up to the first merge: convert _temp_.jpg ( +cl...
by TomXampp
2019-12-31T15:45:50-07:00
Forum: IMagick
Topic: Seeking equivalent Imagick commands
Replies: 5
Views: 2935

Seeking equivalent Imagick commands

I'm using ImageMagick 7.0.8-66 Q16 x64 on Windows 8.1 My PHP is 7.4.1 on XAMPP. I've been running the following command successfully with exec() in PHP: convert _temp_.jpg ( +clone -background black -shadow 88x3+2+2 ) +swap -background none -layers merge +repage -background #eeeeee -layers flatten +...
by TomXampp
2019-09-29T13:00:50-07:00
Forum: Users
Topic: How to create drop shadow on resized image with an extension?
Replies: 20
Views: 8966

Re: How to create drop shadow on resized image with an extension?

FMW42, thank you! You've helped me solve a vexing problem! It all works now, and I've compiled it into a configurable Windows batch file. In case this should help someone else who's trying to solve this or a similar problem, here's the batch code, whose environment variable could be set to parameter...
by TomXampp
2019-09-29T11:46:21-07:00
Forum: Users
Topic: How to create drop shadow on resized image with an extension?
Replies: 20
Views: 8966

Re: How to create drop shadow on resized image with an extension?

It seems we need to subtract 1 from the SHAVE variable, just as we did before with the XOFFSET and YOFFSET variables, so SHAVE should be: shave = ((4*3 - 2*5)/2) -1 It's clear that the "3" is the opacity in the formula (from 3+5+5), but is the "5" the x-offset or the y-offset? And does it switch dep...
by TomXampp
2019-09-29T10:02:07-07:00
Forum: Users
Topic: How to create drop shadow on resized image with an extension?
Replies: 20
Views: 8966

Re: How to create drop shadow on resized image with an extension?

Great! The result of your routine is better than mine, and the routine does seem configurable. There seems to be one fly left in the ointment: If I change the X and Y offsets of the -shadow to 2 and 2, like this: -shadow 63x3+2+2 ...then the image is no longer centered: https://bmt-systems.com/resul...
by TomXampp
2019-09-28T23:38:58-07:00
Forum: Users
Topic: How to create drop shadow on resized image with an extension?
Replies: 20
Views: 8966

Re: How to create drop shadow on resized image with an extension?

Have you tried your method on images to check? It doesn't work as you describe, or perhaps I don't understand. If I understand your explanation, the routine as it stands will work for landscape images. Here is a 4:5 landscape image: https://bmt-systems.com/4x5.jpg After processing it with the routin...
by TomXampp
2019-09-28T20:20:16-07:00
Forum: Users
Topic: How to create drop shadow on resized image with an extension?
Replies: 20
Views: 8966

Re: How to create drop shadow on resized image with an extension?

That does work perfectly for the rose example, but it's not useful for images of other sizes. I'm using this routine to make thumbnails from images of arbitrary sizes. This routine only seems to work for the rose image. The method I outlined earlier, making two clones with a visible (63 opacity) sha...
by TomXampp
2019-09-28T13:57:47-07:00
Forum: Users
Topic: How to create drop shadow on resized image with an extension?
Replies: 20
Views: 8966

Re: How to create drop shadow on resized image with an extension?

It can be verified by opening the resulting image in Photoshop, switching the ruler to pixels, zooming in, and measuring: The left margin is 7px, the right margin is 5px. The top margin is 22px, the bottom margin is 20px. https://bmt-systems.com/result-with-shadow.png It may be easier to see if the ...
by TomXampp
2019-09-28T12:08:40-07:00
Forum: Users
Topic: How to create drop shadow on resized image with an extension?
Replies: 20
Views: 8966

Re: How to create drop shadow on resized image with an extension?

Nice, but it's not perfectly centered. The top margin is greater than the bottom margin (not immediately visible but measurable), and the left margin is visibly greater than the right margin (set the shadow to 0x3+5+5 and you'll see the difference).
by TomXampp
2019-09-28T11:34:27-07:00
Forum: Users
Topic: How to create drop shadow on resized image with an extension?
Replies: 20
Views: 8966

Re: How to create drop shadow on resized image with an extension?

Aha! I figured it out. If I make a second clone and put an INVISIBLE shadow on it shifted to the opposite corner of the image, I'll have an image that, when centered, creates the exact effect I'm seeking: convert rose: -resize 88x88 ( +clone -background #000 -shadow 63x3+2+2 ) +swap ( +clone -backgr...
by TomXampp
2019-09-28T10:45:19-07:00
Forum: Users
Topic: How to create drop shadow on resized image with an extension?
Replies: 20
Views: 8966

Re: How to create drop shadow on resized image with an extension?

Okay, I see what you mean. But that doesn't solve my problem. How do I make the image centered, like this, with the drop shadow falling off the centered image:

Image

?
by TomXampp
2019-09-28T09:47:24-07:00
Forum: Users
Topic: How to create drop shadow on resized image with an extension?
Replies: 20
Views: 8966

Re: How to create drop shadow on resized image with an extension?

Wait, I read some other posts related to this issue, and there appears to be a bug affecting this in the version of IM I was using. So I've installed the current version: Version: ImageMagick 7.0.8-66 Q16 x64 2019-09-22 ...and the rose conversion above completes successfully. I'm very close to solvi...
by TomXampp
2019-09-28T08:46:17-07:00
Forum: Users
Topic: How to create drop shadow on resized image with an extension?
Replies: 20
Views: 8966

Re: How to create drop shadow on resized image with an extension?

Hmm. Something's not working. Let's confirm version compatibility first. I'm using: ImageMagick 7.0.8-47 Q8 x64 2019-05-27 When I run the first example at the "Generating Shadows" tutorial you hyperlinked (http://www.imagemagick.org/Usage/blur/#shadow): convert rose: ( +clone -background navy -shado...
by TomXampp
2019-09-28T00:00:20-07:00
Forum: Users
Topic: How to create drop shadow on resized image with an extension?
Replies: 20
Views: 8966

How to create drop shadow on resized image with an extension?

I'm making JPG thumbnails of images of varying sizes. I'm resizing them while preserving aspect ratio so that neither H nor W is greater than 88px, and the resulting image is centered on a 100x100px #eeeeee "canvas" created with -extent: convert source.jpg -resize 88x88 -background #eeeeee -gravity ...