What is the easiest way to apply a resizing filter (like the ones used by -resize and -distort Resize) to an image without resizing it?
Using -resize and -distort Resize does not do, because TTBOMK if the input and output sizes are the same, the transformation is short circuited to the identity.
The reason I'm asking is that digital photographers would like to filter out moire from the images obtained out of camera, and I suspect that pushing the result through, say, the EWA LanczosSharp filter, or some other cylindrical windowed Jinc filter, without resizing, may be helpful.
P.S. Not that anybody asked, but I've never liked that there is a short circuit when the resize is trivial.
[SOLVED] using a resize filter without resizing
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
[SOLVED] using a resize filter without resizing
Last edited by NicolasRobidoux on 2012-11-10T11:27:59-07:00, edited 1 time in total.
Re: using a resize filter without resizing
In resize.c:ResizeImage(), the shortcut is avoided if filter != UndefinedFilter, so using the "-filter <somefilter>" ahead of "-resize <geometry>" ought to do what you want.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: [SOLVED] using a resize filter without resizing
Thank you Glenn.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: using a resize filter without resizing
That is very useful to know! I didn't and I saw the code!glennrp wrote:In resize.c:ResizeImage(), the shortcut is avoided if filter != UndefinedFilter, so using the "-filter <somefilter>" ahead of "-resize <geometry>" ought to do what you want.
Added the following to the opening notes for Resize Operator
See http://www.imagemagick.org/Usage/resize/#resize (in a few hours)First a small point...
Resize will no nothing itself if the resized image is the same.
The exception to this (there is always an exception) is if you actually specify a Resampling Filter. That is the you give a "-filter" setting, to override normal behaviour. Note however that many filters (even the default filters) can blur images slightly. It is part of there nature. So this default is actually a good thing.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/