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+

2188 questions
4
votes
2 answers

How to resize image using imagemagick?

When I resize image using imagemagick then it shown like cropped. I using below code for resize image ImageMagickObject.MagickImage imgLarge = new ImageMagickObject.MagickImage(); object[] o = new object[] { "image_Input.jpg", "-resize", size,…
Abhishek B.
  • 5,112
  • 14
  • 51
  • 90
4
votes
1 answer

Resize image when getting it from url and showing it in an imageview

Forgive me first, I can not speak English properly. I used Piccaso library for Android to get an image and show that in an imageview in a baseadapter, but they are high volume images. What is the best way to resize the image quickly?
Mersad Nilchy
  • 611
  • 6
  • 18
4
votes
2 answers

What Is Matlab's 'box' Interpolation Kernel

Does anyone know the equation/algorithm/theorem used by MATLAB's 'box' interpolation kernel in the imresize function? Or (even better) know a numpy equivelant?
JDeveloper
  • 91
  • 2
  • 11
4
votes
1 answer

OctoberCMS: Cropping the original image on upload

Given the following code: $car= new Car(); $car->name = Input::get('name'); $car->photo = Input::file('photo'); $car->save(); I need to crop the photo (with offset) before saving it. I tried using the ImageResizer plugin but couldn't figure out how…
B Faley
  • 17,120
  • 43
  • 133
  • 223
4
votes
2 answers

Convert numpy.ndarray into imageio.core.util.Image

I was trying to resize the input image using OpenCV but I am having problems converting the resized np array into the original format. image = imageio.imread(filename) # image_re = cv2.resize(image, (256, 256))…
Pablo Gonzalez
  • 673
  • 2
  • 10
  • 24
4
votes
1 answer

Coldfusion resize making image files bigger?

So I have an image loader that before it uploads the file to Amazon S3 it optimises the image by using this code: The odd thing is that if I upload an…
csber3
  • 175
  • 2
  • 10
4
votes
3 answers

How to resize images for different responsive views?

I created a site with nuxt.js and bootstrap. For the responsive views i need to create different image sizes. Nuxt.js can't resize images. How do you do this?
poldixd
  • 1,103
  • 2
  • 13
  • 27
4
votes
2 answers

How can I set the size of logos the same via CSS?

The images are all of the same sizes. I use Image GIF and the size of the images on the hard disk is 415x72. The images are placed in a table I want to make all images the same via css. Images details on the hard disk: view.jsp: <% logo ="
NewDark Magic
  • 55
  • 1
  • 3
  • 10
4
votes
1 answer

Python OpenCV: Cannot resize image

I am using Python 3 and OpenCV 3. I am trying to use the EigenFace Recognizer which uses the same size images for the training and test dataset. I read the image from a webcam and I resize the images to 200 x 200 but it shows an error . This is my…
user902633
  • 75
  • 1
  • 2
  • 7
4
votes
1 answer

add_image_size with exact width + auto height, but the resized width is limited to a maximum value

I need a little help with resizing images in Wordpress. I want to set exact width of 956px to an image and floating height. I have tried this: add_image_size('full_widthn', 956, 9999, TRUE); add_image_size('full_widthn2', 956, 9999,…
Josef Kuchař
  • 51
  • 1
  • 4
4
votes
2 answers

Resizing external image in Rmarkdown: html vs. ioslides output

I'm using external images in an Rmarkdown document that is meant to be rendered as ioslides and I need to easily resize them. Doing it the html way works both when I knit to ioslides and to html_document.
msoftrain
  • 1,017
  • 8
  • 23
4
votes
2 answers

Opencv resize changing the Pixel value

While training PixelNet, I have tor resize the annotated image(label) that has specific pixel value,before resizing ;the image pixels has specif values(annotated objects) ,np.unique(image) gives [ 0 7 15] However when i resize the image with…
Eliethesaiyan
  • 2,327
  • 1
  • 22
  • 35
4
votes
1 answer

How do I properly resize all aspects of a ggplot in R, including the legend?

I'm making scatterplots in ggplot2 and then using ggsave to export PDFs of specific widths and heights. However, the figure legend never gets properly resized with ggsave (its borders don't stay within the plot). Is there another way to…
Jay
  • 442
  • 1
  • 5
  • 13
4
votes
9 answers

How to resize dynamically loaded image into flash (as3)

Am struggling to find the right as3 code to resize an image once it is dynamically called into the stage and placed in a MC. I am loading using: var myLoader :Loader = new Loader(); mc.addChild(myLoader); var url :URLRequest = new…
Edbro
  • 61
  • 1
  • 1
  • 5
4
votes
3 answers

How to prevent image bombs with ImageMagick?

I currently use Imagick library on PHP and use the resizing functionality of Image Magick. I've just learned about decompression bombs and how ImageMagick is vulnerable to it. I have checked how we can ping the image and verify the dimensions of the…
gerky
  • 6,267
  • 11
  • 55
  • 82