vipthumbnail resizing image without aspect ratio - imagemagick

i want to resize my 800x800px image into 500x1000px using libvips vipthumbnails.
we know that we can force vipthumbnail to ignore aspect ratio and do whatever dimension we want but it will simply distort the image.
resizing 800x800px image to 500x1000px will simply distort the image if we force to follow the given dimension
we simply wants to resize first to 500x500px and then on longer side add the white space in both direction equally distributed. in this case given width is 1000px so both side we will add 250px white space and align the 500x500px part in centre.
so the final image will be 500x1000px and 500x500px image with proper aspect ratio in that frame
vipsthumbnail "/path/original.jpg" --size 500x -o "/path/resize.jpg"[Q=90]
any help will be great. i dont want to use imagemagick as it consumes more memory

Related

How to scale Image with GIMP?

I am trying to change an image to 2688x1242.
But GIMP changes to 2688 to 2606. What should I change, interpolation?
By default, Gimp keeps the aspect ratio (height/width constant). If you want to scale these independently, you click the chain link icon between the width and height fields to open it:
You can then use arbitrary values, with the caveat that this can make your image look distorted (flattened/stretched). Usually, you scale the image keeping the aspect ratio, and either add margins on the side that is too small, or crop some on the side that is too big.

Trying to clip edges from UIImage to fit to ImageView

I have added an icon to my assets to be used in an image view. However, When I put it in an image view the outer edges seem to be larger than the image itself. Is there any way I can fully fill the image. Even when I try scale to fill or aspect fill, fit options still there remains a margin in between.
In other words I want my circular image to be tangent to the image view rectangle
The example of what I am trying to do

issue with the image alignment?

I am trying to put the image at the top of of my device and these are the constrains that i am applying
The result that i am getting by applying this result is
so there is some black space left at the top, i want that my image should stick to the top, i want to conserve the aspect ratio of the image and can't clip it so i can't use aspect fill. Can someone help me out with this

When iOS shrinks an image, does it clip/pixelate it?

I have 2 relatively small pngs that will be images inside UIButtons.
Once our app is finished, we might want to resize the buttons and make them smaller.
Now, we can easily do this by resizing the button frame; the system automatically re-sizes the images smaller.
Would the system's autoresize cause the image to look ugly after shrinking the image? (i.e., would it clip pixels and make it look less smooth than if I were to shrink it in a photo editor myself?)
Or would it better to make the image the sizes they are intended to be?
It is always best to make the images of correct size from the beginning. All resize-functions will have negative impact on the end result. If you scale it up to a larger image it will be a big different, but even if you scale it down to a smaller it is usually creating visible noise in the image. Let's say that you have a line of one pixel in your image. scale it down to 90% of the original size, this line will just use 90% of a pixel wide and other parts of the images will influence the colors of the same pixels.

Zoom image until it fits ImageView Completely

I have a simple UIImageView and an image. I want to fit the image in that UIImageView but I don't want the image aspect ratio to change and I also don't want any dead spaces. ( black bars on the sides etc') I don't care if the image is zoomed in all the way as long as those 2 rules are applied.
Is there a build in setting for that? I tried all the Scale To Fill and Aspect Fill etc' but couldn't find what I'm looking for.
For example: UIImageView is 300x300
image is 200x250. The image will zoom in until all the areas of the UIImageView are filled.
For a UIImageView you can use Aspect Fill in the properties to do this.
But you may have to tick the box "Clip Subviews" otherwise the image will spill outside the image view frame.

Resources