image-resizing

Python: Image resizing: keep proportion - add white background

巧了我就是萌 提交于 2019-12-22 06:49:23
问题 I would like to create a Python script to resize images, but not changing its proportions, just by adding a white background (So, a : 500*700 px image would transform to a 700*700 px image by adding 100 px of a white band on each side) The three image types I use are .PNG, .JPG and .GIF . I am not even sure it is possible for Gifs, PNG and JPG would already be awesome. In my case, they have to be squares. But if any of you manage to do it for adaptable to any proportion, it would benefit the

PHP resize from URL

ⅰ亾dé卋堺 提交于 2019-12-22 00:18:44
问题 I've edited the basic php.net script for resizing to work for my specs. It works with local files but when it comes to remote files (this is trying to resize images from a wordpress blog to go with the blog posts) I can't seem to figure out how to GRAB the image, manipulate it, then output it. // The file $filename = 'like-father-like-son.jpg'; // Set a maximum height and width $width = 150; $height = 150; // Content type header('Content-Type: image/jpeg'); list($width_orig, $height_orig) =

Resizing a image with Javascript without rendering a canvas on the DOM

送分小仙女□ 提交于 2019-12-21 17:44:17
问题 I've seen this interesting thread among many others: Resize a Base-64 image in JavaScript without using canvas However when i create an off screen canvas using const canvas = document.createElement('canvas'); the result image is transparent and the size does not even match the parameters. If i draw on a canvas from the DOM everything works fine const canvas = document.getElementById('canvas'); Here is my resize function that keeps the input image ratio : resizeImage(file) { const canvas =

Symfony2 : Resizing uploaded images

和自甴很熟 提交于 2019-12-21 05:27:15
问题 Is there any way to resize pictures while uploading them in Symfony2 ? The ImagineAvalancheBundle only allows to resize images to thumbnails when retrieving them, which is not really performant to me. Besides, the UploadedFile object retreived when posting data doesn't seems to have resizing methods... Any Idea ? 回答1: I had the same problem you are asking for. The main issue is that the bundle resizes and/or crops the images directly. So that can take a lot of time with big images and if many

Resizing the image with padding using convert on ubuntu

谁说胖子不能爱 提交于 2019-12-20 17:38:26
问题 I am using the convert command for resizing the image There are two versions Following is the first one, the resultant image maintains the aspect ratio but the image does not necessarily be of size nxn convert temp.jpg -resize nxn temp.jpg The second version convert temp.jpg -resize nxn! temp.jpg It does not preserve the aspect ratio. What I want is to preserve the aspect ratio, and fill the rest of the image with a desired RGB value to acheive the size nxn Any ideas? Thanks 回答1: You need to

Serving Images with on-the-fly resize

浪尽此生 提交于 2019-12-20 08:07:10
问题 my company has recently started to get problems with the image handling for our websites. We have several websites (adult entertainment) that display images like dvd covers, snapshots and similar. We have about 100'000 movies and for each movie we have an average of 30 snapshots + covers. Almost every image has an additional version with blurring and overlay for non-members, this results in about 50 images per movie or a total of 5 million base images. Each of the images is available in

ImageMagick or GD Library for image resizing and thumbnail creation?

瘦欲@ 提交于 2019-12-20 07:39:13
问题 I had been using the image resize class written by someone else to resize images or to create the thumbnails, here is the link to the class I had been using. http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php I guess image GD library has some limitations for the resolution or the file size of images, it works fine for low resolution picture resizing(below 1024px) but it does not resize if I try to upload the high resolution jpeg image (i.e 3400px X 2200px) roughly, The

no repaint while resizing when using .setPaint(gradient)

爷,独闯天下 提交于 2019-12-20 04:08:07
问题 As soon a I use gradients in my code, the repaint isn't done while resizing I get something like that while resizing (black rectangles where it has been resized, see image in the link below). And when i stop resizing, everything is drawn again, but only then. if I don't use g2d.setPaint(gradient); I have a quick redraw http://gui-builder.com/C41142775162.rar public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D)g; //sample of the code GradientPaint

Qt: How do I resize an image and maintain its proportions? [duplicate]

…衆ロ難τιáo~ 提交于 2019-12-19 15:58:32
问题 This question already has answers here : How do I make an image resize to scale in Qt? (2 answers) Closed last year . This Qt example shows how to resize an image contained in a dialog, so that when the dialog is resized, the image stretches accordingly. How can I resize an image in the same way, without distorting it / keeping its proportions the same? Of course if the width/height ratio of the dialog is different from the one of the image, I will get a "grey" area. I found the Qt:

Image resizing on the fly in asp.net

拟墨画扇 提交于 2019-12-19 10:38:10
问题 For simplicity lets say that I have a web page that needs to display thumbnails of images. The images locations are stored in a database(the images are stored on Amazon S3). Is it possible to have my web server scale down the large image before it is delivered to the client? This way I don't have to store thumbnails of every image and the client can download a smaller file. 回答1: Sure, no problem. There's plenty of resources on the web that show how to dish up an image from a database. So I