Questions tagged [image-resizing]

Image resizing is the downscaling or upscaling of an image. Dozens of algorithms exist, all with performance vs. quality tradeoffs.

Image resizing (also called image scaling) is the downsampling or up-sampling of an image using an interpolation algorithm. Common downscaling algorithms are Lanczos, Bicubic Sharper, Bicubic Smoother, Fant, Bicubic, Bilinear, and NearestNeighbor (listed in order of average result quality). Fractal algorithms often produce better results for upscaling photos, while there are many algorithms optimized for upscaling pixel art.

Due to algorithmic complexity, most developers use library implementations of these algorithms.

FreeImage

Offers CatmullRom, Lanczos3, bspline, box, bicubic, and bilinear filters. FreeImage focuses on implementation simplicity, and doesn't use hardware accelerations or SIMD extensions, so these speeds may not be acceptable for real-time display of images.

Windows GDI+

While loathed by many, GDI+ does include an excellent 2-pass Bicubic filter. It offers: 2-pass Bicubic, 1-pass bicubic, bilinear, and nearest neighbor. Those using it should be aware that it may add rings to images unless WrapMode is set to TileXY, as otherwise the algorithm samples data from outside the image bounds.

WIC (Windows Imaging Components)

The IWICBitmapScaler class offers Fant, 1-pass bicubic, bilinear, and nearest neighbor. Implementations are optimized for performance, and can be 2-4x faster than their GDI counterparts, although there isn't currently a 2-pass bicubic filter such as offered by GDI+

2028 questions
0
votes
1 answer

Should we scale image before setting it to a imageView in UITableView

I am displaying a list of images with names, with a chevron accessory to see the full size version of selected image. I see that the scrolling performance is not super smooth. I think the reason is that the image I am assigning to the imageView of…
0
votes
2 answers

change resolution and size of image with cocoa/osx/swift (no mobile apps)

I try to change the size and the resolution of an image programmatically, afterwards I save this image. The imagesize in the imageView is changing, but when I look at my file "file3.png" it always has the original resolution of 640x1142. I googled…
kuzdu
  • 5,943
  • 1
  • 37
  • 56
0
votes
1 answer

WinJS/WinRT Change resolution (dpi) of image

Some time ago I wrote some code to modify an image size in a modern UI WinJS application using the WinRT API. Now I'm being asked to also change the image resolution to 2.7 times its biggest side (don't ask). Problem is I can't find the proper way -…
0
votes
0 answers

Resizing image without keeping aspect ratio

I want to be able to resize my icons so that I can change the aspect ratio. I have the image of a rectangle and I want to be able to stretch it to any size, but when I resize it, it fills the empty space with padding instead of stretching it. I used…
0
votes
1 answer

What is the best image width for mobile browsers in vertical mode?

I am creating an extremely simple web page: it simply shows images one after the other until the bottom of the page. Problem is... I am not sure what size images we should be using. What is the ideal width of the images in a vertical browser? …
user198923
  • 471
  • 1
  • 5
  • 17
0
votes
1 answer

bootsrap - keeping IMG same size and centered for XS

how would i go about keeping an IMG the same size and having it stay centered for only size XS in bootstrap? My code is identical to this: http://jsfiddle.net/dpvarcfe/
Ghost Echo
  • 1,777
  • 3
  • 30
  • 43
0
votes
2 answers

Will auto layout scaling always produce the same result no matter the resolution?

Is there a way to have each preview/simulator match the look of the storyboard, look for look, regarding the same location and aspect ratio no matter the screen size? In other words, in my storyboard I have the look I am looking for. What…
jonpeter
  • 579
  • 7
  • 26
0
votes
1 answer

Resize image without aspect ratio

i want to resize my bitmap image to 512px,512px. i use below code ,but when my image resized its very bad and aspect ratio affected. how i can resize my image without aspect ratio?2nd image resized with pc to 512px. public Bitmap…
Mahdi
  • 377
  • 2
  • 20
0
votes
1 answer

Storing different versions of an image vs resizing on request

I am writing an App for android in which the user can upload images. My idea is now resizing the image on client side to the maximal required resolution for xxhdpi. After I send it to the server and on server side I store the xxhdpi version. Now the…
Mischa
  • 53
  • 6
0
votes
0 answers

Resize Image in PHP Using Croppie

I am trying to resize an image which is taken from a cropping tool used on my form. The code below is being used with the library Croppie. if($_POST['imagebase64'] != '') { $data = $_POST['imagebase64']; list($type, $data) = explode(';',…
user4780686
0
votes
2 answers

Images won't resize in style or in the img itself

I have been stuck with this problem for almost two days already, I am a quite new programmer, and it's probably quite easy to solve. I have to make a small game with images and words, but the images won't resize. Before they would just resize in…
A.Jaasma
  • 93
  • 10
0
votes
2 answers

Re-size all images in a folder to 90% of original height and width (windows)

I have a situation where I need to re-size a lot of images in a folder by a certain %. All the images are different heights and widths so I cannot just say 400 x 300 reduced by 10% is now "X by Y". It's also very inefficient to go through each one…
spike_stack
  • 731
  • 4
  • 16
0
votes
3 answers

resize picture c# for web

Goal: I have lots of pictures in many sizes (both dimensions and file size) I'd like to convert these files twice: thumbnail-size pictures pictures that will look OK on a web page and will be as close to a full screen as possible... and keeping the…
Asaf
  • 2,857
  • 9
  • 31
  • 52
0
votes
1 answer

Upload resized image with Javascript / AngularJS

We are building an application where the user can upload images, but I need to resize an image before I can upload them to the server. The input for the file is an input[type=file] and we check if the image is valid. If it is valid, we continue with…
Sietse
  • 573
  • 1
  • 5
  • 22
0
votes
0 answers

Optimize resizing picture on a button with PIL

self.image2Code: from tkinter import * from tkinter import font from PIL import Image, ImageTk class App(Tk): def __init__(self): Tk.__init__(self) self.variables() self.makeUI() def variables(self): self.buttonlist = [] …
1 2 3
99
100