when i resize big tiff image to less than 25% ( say 17% ), the pixels are wrapped from left to right - resize

im using image magick v7.16.0. i have a very big image of size 440*1700. i want this to be resized to 17% of the original Size.
I tried with Resize, Scale and Rescale methods with intended width/height parameters and also with MagicGeometry.
But the resized image wraps the pixels from left side to right side.Click here for the image
Can any one help me in understanding why this wrapping is seen ?
This wrapping is seen only when i resize to less than 25%. [ when i resize to 50% or 80% i dont see this wrapping ]

Related

Imageresizer doe not crop the width but only crops the height

Having an issue with my images not being cropped using imageresizer. It crops fine on the height but does not crop the width.
here is an example: https://media.hillarys.co.uk/asset//media/10222/zen-collection-mishima-dawn-curtains.jpg?width=850&height=450&mode=Crop&quality=70
If I set the height to 400 it crops fine. However if I set the width to 300. It will resize the image.
This is really starting to get frustrating now. Any help?
Thanks
I see an image that is 850x450 pixels.
mode=crop (compared to mode=max or mode=pad) minimally crops to achieve the required aspect ratio, then scales the image down the the precise dimensions you requested.
If you don't want a minimal crop, then you should use crop=x1,y1,x2,y2. These can be expressed as percentages instead of coordinates with cropxunits=100&cropyunits=100.

Re-sizing visual image while maintaining image dimensions

I'm working with documents, so maintaining the the original image dimensions and subsequent dpi is important.
The aspect ratio is always maintained so the automatic fill modes and alike don't seem to have any effect.
Say I have a 300 dpi document and the user want to clear an inch border around the image. So I need an inch cropped from the image but the result needs to be the original image dimensions (2550x3300).
I have been able to achieve this effect with...
...&crop=300,300,-300,-300&margin=300,300,300,300
This works, but seems more than a little clunky. I've tried a lot of other combinations but they all seem to enlarge or reduce the image size which is undesirable in my case.
So does someone know a simpler syntax to achieve the desired result, or do I need to re-size the image then calculate and fill with a margin as I'm doing now.
Thanks
It turns out that my example requests the image in it's full size which turns out to be a special case. When I introduce a width or height into the command line things don't work very well since crop size is in respect to the original image dimensions and margin size is in respect to the result image.
Thinking about it more I abandoned the crop approach. What I really needed was a way to introduce a clipping region into the result bitmap. So I built an extension to do just that. It works well as it doesn't interfere with any of Resizer's layout calculations and the size of the returned image is whatever the height or width were specified as. Which is just what I needed. The Faces plugin has an example of introducing a clipping region.
Karlton
Cropping and re-adding 300px on each edge is best accomplished exactly the way you're doing it:
&crop=300,300,-300,-300&margin=300
What kind of improved syntax would you expect? This isn't a common operation.

How to crop based on scaled dimensions?

Is there a way to scale an image down in size by say, 50 percent, and crop the scaled output? I've been tinkering with this, but it seems that any cropping is based on the original image dimensions rather than the scaled dimensions.
Cropping by percentage:
?crop=20,20,80,80&cropxunits=100&cropyunits=100
Cropping by the output size:
?width=400&height=300&crop=80,60,320,240&cropxunits=400&cropyunits=300

drawInRect loses resolution when drawn to smaller image?

When i draw a large image (say 1000x1000 pixel) using drawInRect method with size say 200x200 pixel and again i use drawInRect method to draw the image to its original size (1000x1000 pixel) does the resolution affect by using this ? Does the resolution decreases by drawing large image into small and again that same image to large image ?
Hopefully I've gotten your question correct in my head.
If you take an image bigger than 200x200 pixels and draw it into a 200x200 pixel rectangle, it'll get scaled down and lose most of its detail. If you then take the resultant image and try to draw it in a bigger rectangle it'll just get scaled up. So, to answer you're question, yes. It'll look blurry as hell. It's no different than resizing an image down in a graphics editor then blowing it back up to its original size. The loss of detail is permanent; there's no way to know what was lost in the transition down.

Scaling an image from the iPhone - iOS App

I let the user select a photo from the iPhone library, and I grab the UIImage.
I output the size of the image, and it says 320x480, but it doesn't seem to be, because when I draw the image on the screen using CGRectMake(0,0,320,480), it only shows the upper left portion of the image. Aren't the images much bigger than 320x480 because of the high resolution?
I'd like to scale the image to force it to be 320x480. If it is less than 320x480, it should not be rescaled at all. If the width is greater than 320 or the height is greater than 480, it should scale in a way so that it becomes as close to 320x480 as possible, but by keeping the proper proportion of width to height. So, for instance, if it scales to 320x420, that is fine, or 280x480.
How can I do this in Objective-C?
Setting the image view's content mode like this:
myView.contentMode = UIViewContentModeScaleAspectFit;
will preserve the aspect ratio.