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
0
votes
1 answer

How to convert batch of rectangular images into square images without cropping?

Given batch of vertical and horizontal rectangular images : rect-h.png rect-v.png How to convert batch of vertical and horizontal rectangular images into square images ? So to get same sizes, not-cutted, no disformed : rect-h-sq.png …
Hugo LOPEZ
  • 605
  • 8
  • 21
0
votes
0 answers

How to use Capabilities in Air AS3 to determine correct dpi

I am currently looking into the best practices of implementing images and graphics to a new Adobe air project and would like to know which is the best practice in using images . I have a fair bit of experience in Flash with web development and am…
clm
  • 1
  • 3
0
votes
1 answer

How to resize animated gif file using imagemagick without destroying animation using C#?

I am using imagemagick DLL (Refer: http://www.imagemagick.org) for the resize image, But when I re-sized animated GIF image then it going screw. I using below code for re-size image ( image type are png, gif, jpg, bmp, tif…
Abhishek B.
  • 5,112
  • 14
  • 51
  • 90
0
votes
1 answer

How to resize image on codeigniter?

I get a module like a blog, and I must upload an image to my website. but when I upload my image not be resized/cropped automatically. CONTROLLER function simpan_campaign(){ $config['upload_path'] = './assets/images/upload'; //path folder …
0
votes
1 answer

Bicubic interpolation results different from FFMPEG

I just implemented bicubic interpolation for resizing images. I have a test image 6x6 pixels (grayscale), its columns are black and white (x3). I am comparing the results of my code with the results from the tool ffmpeg and they are not correct. I…
Pedro Pereira
  • 312
  • 5
  • 21
0
votes
4 answers

Why is my image not resizing when other attributes are working fine?

I have been trying to resize this image in the following code. I have tried px, em, % and leaving the unit type blank but it will not resize. I have tried both width and height but neither make it change. The other attributes in the CSS are working…
0
votes
1 answer

Resizing Images for OpenCV fisherface recognizer

I am working with OpenCV Contrib framework to preform facial recognition. My problem is that when isolating the faces (using a for loop) OpenCV crops the test image to only show the face (like a 40x40 box around a face). I need to resize this image…
coder
  • 381
  • 2
  • 22
0
votes
1 answer

resizing images in jQuery

I've set up a small demo that automatically resizes an image to fit inside it's container div when it is clicked. It works by taking the size of the image then dividing that by the size of the box and working out which ratio is higher before…
Sam
  • 99
  • 5
  • 14
0
votes
1 answer

Zoom image from the cursor position

I start with a image in a DIV, i want to zoom in the image with my mousewheel. All is ok but the zoom in start at the xy0 of the image and it is not what i want.. I want to Zoom from my cursor position. There is a way to do that simply under my code…
0
votes
0 answers

Resize an image in C / SDL 1.2

I have a 64x64 image and I want to resize it just as I want within my program (make it 32x32 or 86x86 for exemple). How can I do it? I use SDL 1.2 in C.
Maxime Beasse
  • 55
  • 2
  • 12
0
votes
1 answer

PHP image resize not working

I'm trying to create a thumbnail from a JPG image, but I can't get the resized image to output properly ("contains errors"). Here's my code, I can't figure out what's wrong:
bur
  • 604
  • 5
  • 20
0
votes
1 answer

ImageResizer - Need to remove images that are in the image cache

I use the ImageResizer tool with the DiskCache plugin. We use Azure blob storage to store images and a custom plugin to serve those images within the resizer code. Something went awry and some of the blobs have been deleted, but are cached in the…
GFree
  • 31
  • 5
0
votes
1 answer

Resized image uploading

I am working on a Laravel application and at some point, when I allow users to upload their own images for different purposes, I want to generate resized previews for these images. I am uploading all user content to Amazon S3 and the first thing I…
Victor
  • 13,914
  • 19
  • 78
  • 147
0
votes
0 answers

Stop image in tumblr theme from stretching to full size of post

I'm using the free tumblr theme Salvia (https://www.tumblr.com/theme/40508) and it stretches images in text posts to the full width of the page. I would like the images to not stretch and stay the size it is. I've tried editing PhotoURL in the…
Charlene
  • 1
  • 1
  • 3
0
votes
1 answer

Drag and Drop multiple images, resize them at client side and get resized images

How can I drag and drop multiple image on HTML page, resize the images at client side and download the resized images to computer? I want to accomplish this without any server side processing. I have tried below solution where one image can be…
Rohan
  • 11
  • 5