mergeing stips with offset

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?".
imaggie
Posts: 88
Joined: 2011-12-19T04:15:36-07:00
Authentication code: 8675308

Re: mergeing stips with offset

Post by imaggie »

OK, I get what it's doing. The linear matrix transformation gives the new coordinates and then the specified interpolation method ( misnamed lookup or filter ) calculates the colour values for each plane. That's great, that's what I was looking to do.

However, it seems to bomb out when I try to do a calculated resize. If I -resize '%[fx:100]'%,100% ( aka NOP )

[EDIT] OK it can't handle the % after the fx escape for some reason. The final one is enough.

Code: Select all

magick  junocam_efb12_roll.png  -crop 1648x128  +repage -delete "$list2,$list3"  -crop 1648x115  -filter Catrom -resize '%[fx:100+s*5]',100%    +repage  -append efb12_collateG.png
This seems to be a 1:1 scaling too, ie "s" is not having any effect. Am I still not using the correct variable for the tile number?

Is there a way to get it to print out how it is interpreting that command?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: mergeing stips with offset

Post by fmw42 »

On IM 7 unix try this by escaping the second % and putting the whole expression is quotes.

Code: Select all

magick inputimage.jpg  -resize "%[fx:50]\%x%[fx:50]\%" outputimage.jpg
or

Code: Select all

magick inputimage.jpg  -resize "%[fx:w/2]x%[fx:h/2]" outputimage.jpg
on windows, I believe the escape is ^% rather than \%
imaggie
Posts: 88
Joined: 2011-12-19T04:15:36-07:00
Authentication code: 8675308

Re: mergeing stips with offset

Post by imaggie »

Thanks Fred.

OK that makes sense since % is an escape char it needs escaping itself. [ oof ] Since it was in context at the end it worked anyway, and only one % is needed to force both ...

I also found I should be using "t" for the tile index. That works a lot better.

Now I'm trying to use a w,h resize as you indicated but it is not getting any wider :

Code: Select all

 -resize '%[fx:w+t*30]'x'%[fx:h]'
Ah, I was missing the "!" to force the dimensions. Getting there slowly.
imaggie
Posts: 88
Joined: 2011-12-19T04:15:36-07:00
Authentication code: 8675308

Re: mergeing stips with offset

Post by imaggie »

OK, I have managed to stitch all the strips together. There are remaining issues to get a nice full image since there is a time lag between NH and SH sections and the position and viewing angle of the craft has changed. Would require a non linear stretch / compression across x in one or other hemisphere to fudge the two together. This obviously could also be done by a pixel level -fx process.

I also did a manual shift in GIMP to align the upper and lower sections.

The Juno images from Jupiter are pretty under-whelming, so I have rather lost the motivation to spend any more time on this but it was worthwhile for what I've learnt about IM.

Code: Select all

magick  junocam_efb12_roll.png  -crop 1648x128  +repage -delete "$list2,$list3"  -crop 1648x115+'%[fx:t*6]+0'  -filter Lanczos    -resize '%[fx:(t<10)?w*(1+0.0122*(t+1.5)):w*(1+0.0122*t)]'x'%[fx:(t<10)?h*(1+0.0122*(t+1.5)):h*(1+0.0122*t)]!'       +repage  -append efb12_collateG.png
https://climategrog.files.wordpress.com ... atched.png

Many thanks to all for the tips and explanations.
Post Reply