Questions tagged [image-scaling]

The use of interpolation to spatially stretch or squeeze an image by manipulating the underlying image data -- directly, or through API or ABI calls.

639 questions
591
votes
26 answers

How to scale an Image in ImageView to keep the aspect ratio

In Android, I defined an ImageView's layout_width to be fill_parent (which takes up the full width of the phone). If the image I put to ImageView is bigger than the layout_width, Android will scale it, right? But what about the height? When Android…
michael
  • 106,540
  • 116
  • 246
  • 346
153
votes
8 answers

HTML img scaling

I'm trying to display some large images with HTML img tags. At the moment they go off the edge of the screen; how can I scale them to stay within the browser window? Or in the likely event that this is not possible, is it possible to at least say…
rwallace
  • 31,405
  • 40
  • 123
  • 242
141
votes
14 answers

High Quality Image Scaling Library

I want to scale an image in C# with quality level as good as Photoshop does. Is there any C# image processing library available to do this thing?
Ramesh Soni
  • 15,867
  • 28
  • 93
  • 113
112
votes
11 answers

Resizing an Image without losing any quality

How can I resize an image, with the image quality unaffected?
public static
  • 12,702
  • 26
  • 66
  • 86
104
votes
14 answers

c# Image resizing to different size while preserving aspect ratio

I'm trying to resize an image while preserving the aspect ratio from the original image so the new image doesn't look squashed. eg: Convert a 150*100 image into a 150*150 image. The extra 50 pixels of the height need to be padded with a white…
sf.
  • 24,512
  • 13
  • 53
  • 58
87
votes
8 answers

Android ImageView scale smaller image to width with flexible height without cropping or distortion

Often asked, never answered (at least not in a reproducible way). I have an image view with an image that is smaller than the view. I want to scale the image to the width of the screen and adjust the height of the ImageView to reflect the…
Mundi
  • 79,884
  • 17
  • 117
  • 140
58
votes
7 answers

How to scale a BufferedImage

Following the javadocs, I have tried to scale a BufferedImage without success here is my code: BufferedImage image = MatrixToImageWriter.getBufferedImage(encoded); Graphics2D grph = image.createGraphics(); grph.scale(2.0, 2.0); grph.dispose(); I…
Thiago Diniz
  • 3,041
  • 5
  • 30
  • 35
46
votes
13 answers

Is there a way to load image as bitmap to Glide

Im looking for a way to use bitmap as input to Glide. I am even not sure if its possible. It's for resizing purposes. Glide has a good image enhancement with scale. The problem is that I have resources as bitmap already loaded to memory. The only…
Maher Abuthraa
  • 17,493
  • 11
  • 81
  • 103
43
votes
2 answers

Python / Pillow: How to scale an image

Suppose I have an image which is 2322px x 4128px. How do I scale it so that both the width and height are both less than 1028px? I won't be able to use Image.resize since that requires me to give both the new width and height. What I plan to do is…
SilentDev
  • 20,997
  • 28
  • 111
  • 214
36
votes
3 answers

How to check similarity of two images that have different pixelization

I am running a python code to check similarity of Quora and Twitter users profiles photos, but i am not getting a positive result when images are the same. This is the code for comparing the two images : path_photo_quora=…
36
votes
1 answer

What is the idea behind scaling an image using Lanczos?

I'm interested in image scaling algorithms and have implemented the bilinear and bicubic methods. However, I have heard of the Lanczos and other more sophisticated methods for even higher quality image scaling, and I am very curious how they…
horseyguy
  • 29,455
  • 20
  • 103
  • 145
35
votes
7 answers

Resizing an image in asp.net without losing the image quality

I am developing an ASP.NET 3.5 web application in which I am allowing my users to upload either jpeg,gif,bmp or png images. If the uploaded image dimensions are greater then 103 x 32 the I want to resize the uploaded image to 103 x 32. I have read…
Kumar
  • 2,863
  • 11
  • 45
  • 60
30
votes
2 answers

image Scaling of picture box

i got a problem with image scaling in C#. I have a picture Box with given Size : e.g. width = 800px height = 600px I am loading different images into that picture box, small ones ( 400x400) and big ones (800+ x 600+) My images are getting resized if…
pila
  • 928
  • 3
  • 11
  • 28
26
votes
5 answers

Resize transparent images using C#

Does anyone have the secret formula to resizing transparent images (mainly GIFs) without ANY quality loss - what so ever? I've tried a bunch of stuff, the closest I get is not good enough. Take a look at my main…
MartinHN
  • 19,542
  • 19
  • 89
  • 131
25
votes
1 answer

Crop to fit an svg pattern

I have patterns that each have a single image in them. I need the images to scale to the full width or height of their containers, which are paths, while retaining their proportions. Essentially, they need to behave like an html image might if you…
raphaeltm
  • 817
  • 1
  • 12
  • 22
1
2 3
42 43