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 link javascript and html for resizing?

I am new to javascript, and is trying to follow the resizing tutorial here. I created three files in the same folder, with index.js and style.css by directly copying and pasting the demo. The followings are the index.html, index.js, and style.css.…
KubiK888
  • 4,377
  • 14
  • 61
  • 115
0
votes
1 answer

CSS FlexBox and image resize

I'm actually playing with flexbox, and I can't archive to resize an image in a container that have an adapative width. Also here is a plunker for this code : https://plnkr.co/edit/QaPzOVXSx5iYQXOsit9V?p=preview Also a direct preview :
Lucsartes
  • 321
  • 2
  • 13
0
votes
1 answer

Unable to change image size proportionally

I am building an interactive website where the main image is a camera with buttons to operate it. I want to place buttons on it for the user to click on. I am able to position it just fine at full width, and when I resize smaller for a phone the…
rlearning
  • 35
  • 5
0
votes
0 answers

Image resize with black background CodeIgniter 3.x

Controller: Where I'm resizing an image before uploading, the image is resizing properly and the old uploaded image is also deleted when the new image is uploaded by the user. But the only problem is, it gets uploaded with black background, and when…
0
votes
1 answer

Rotating a BufferedImage causes it to change its position

I'm trying to rotate a bunch of BufferedImage instances, the rotate works, but what's odd is that they change their position. Here's a snippet of how I do it. BufferedImage philo1=ImageIO.read(new File("D:\\philo1.png")); public void paint(Graphics…
Amine
  • 1,396
  • 4
  • 15
  • 32
0
votes
0 answers

Python OpenCV How to get face image dataset from webcam same size image?

I use Python 3 and OpenCV 3. I want to get face image dataset from webcam same size image. This is my code. import cv2 import numpy as…
user572575
  • 1,009
  • 3
  • 25
  • 45
0
votes
1 answer

How to reduce the size of image while uploading in codeigniter?

I'm now working in Codeigniter, have some issue in resizing the image while uploading. I have tried some code, but not working fine. Below I have added my file upload function: public function add_to_event() { if…
user7563473
0
votes
2 answers

Php multiple image upload fails when i select many images

I use this code below, to upload and resize multiple images. If i select about 10-20 image, everything works fine, but if i select 50 or more images, nothing happens, the page just reloads after a few seconds. The code has some problem, or the max…
0
votes
0 answers

Can't fit the labels in ggplot

I have been trying to shrink the size of my graph because significance levels don't fit in. I have tried smaller label sizes or saving in different width and height. However, it didn't work well. Does anyone know how can I fit the plot well? My…
Mel
  • 11
  • 5
0
votes
0 answers

Resizing-scaling the image in JTextPane

I want to scale and resize with mouse selected image, change selected image with corner point, and change scale picture in JTextPane as in Microsoft Word. This code just added image without change size in text editor but not have function propertes…
0
votes
1 answer

Add watermark and resize image in PHP

I need to add watermark on uploaded image and also resize it to make thumbnails and icons from that watermarked image. Below is my function code which is adding watermark but I can't find out how to resize image to given height and width: function…
Umair Malik
  • 1,403
  • 3
  • 30
  • 59
0
votes
2 answers

How to compress image size before saving to database without losing quality

i have a from and from that i forced user to upload a image and other details etc....And in my root directory i created one folder called(user_images) Every thing is fine , but the problem is..user may insert large files so that loading of webpage…
lohith kumar
  • 55
  • 4
  • 11
0
votes
2 answers

Is there imresize analog that can work with more than 8 bit colors in Python?

I want to resize image that's represented by uint16 values in each color channel. If I use imresize it converts data to uint8 values. How can I preserve uint16 and resize image? Also I would like to use interp='lanczos' resizing method - to not just…
Dmitry
  • 14,306
  • 23
  • 105
  • 189
0
votes
1 answer

can't resizing images in Universal Image Loader before displaying

I am using of Android Universal Image Loader and I want to resize images my recycler view items and my slider. I used this method in my slider's viewPager: public class ViewPagerAdapter extends PagerAdapter { private ArrayList imageUrls; …
Ehsan
  • 2,676
  • 6
  • 29
  • 56
0
votes
0 answers

Resize a jpg image before uploading to server

In my app I need an image chooser option, by which user can choose image from library, also take image from camera to upload it to server. Now , I use volley library to sent Post request from the app. The image should be in jpg format as server only…
1 2 3
99
100