It is currently Wed Jul 03, 2024 11:30 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Resize image without stretching
PostPosted: Sun Jan 06, 2019 2:37 pm  (#1) 
Offline
New Member

Joined: Jan 06, 2019
Posts: 4
GIMP Version: 2.8.14
Operating System: Windows
OS Version: Windows 10
GIMP Experience: New User



Hey, guys, I'm brand new to gimp and this is my first post. I'm trying to figure out how to resize a png image without stretching it. I've looked all over youtube and did a bunch of google searches but can't find a tutorial that uses the newest version of gimp (2.10.8) that I just downloaded today. Some of the buttons they list aren't where they should be. If you're wondering I'm resizing a bunch of png files for an android boot animation so that the boot animation will fit the resolution of the screen on my phone. The current size of the images are 640x400 and I need to resize them to fit my phone which is 1440x2560 without stretching.


Attachments:
File comment: One of the images needing to be resized.
022.png
022.png [ 3.08 KiB | Viewed 12505 times ]
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Resize image without stretching
PostPosted: Sun Jan 06, 2019 2:55 pm  (#2) 
Offline
GimpChat Member

Joined: Sep 23, 2016
Posts: 316
Different aspect ratios, so something will have to stretch.
640/400 = 1.60
2560/1440 = 1.78

Or you could add some black padding.

Create a black canvas with size 2560 x 1440
Scale the image from 640 x 400 to 2304 x 1440
Copy and paste this image onto the black canvas


Top
 Post subject: Re: Resize image without stretching
PostPosted: Sun Jan 06, 2019 4:03 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Nov 04, 2015
Posts: 1365
Quote:
the images are 640x400 and I need to resize them to fit my phone which is 1440x2560 without stretching.

Notice the original width of 640 is bigger than the height of 400?
Notice you want to scale the phone image to a width that is smaller than the height?

Maybe have a think about how you want it to be viewed?
BTW Welcome to Gimp Chat :)


Top
 Post subject: Re: Resize image without stretching
PostPosted: Sun Jan 06, 2019 4:17 pm  (#4) 
Offline
New Member

Joined: Jan 06, 2019
Posts: 4
Blighty II wrote:
Different aspect ratios, so something will have to stretch.
640/400 = 1.60
2560/1440 = 1.78

Or you could add some black padding.

Create a black canvas with size 2560 x 1440
Scale the image from 640 x 400 to 2304 x 1440
Copy and paste this image onto the black canvas


How exactly would I do that? Any good tutorials? I'm a total noob to gimp.


Top
 Post subject: Re: Resize image without stretching
PostPosted: Mon Jan 07, 2019 12:42 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jan 08, 2018
Posts: 101
Location: The Netherlands
I would crop it first with the new dimensions for your phone (in the tool options on the side panel) and then make sure it has the right resolution with 'Scale image' under the image tab.

_________________
Image


Top
 Post subject: Re: Resize image without stretching
PostPosted: Mon Jan 07, 2019 5:50 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
The edges of those tiny balls will look very ugly after x3 upscaling.
After scaling the original to 2560, use image: canvas size and crop it to 2560x1440. This will work as your help layer.
Create new black layer and over it transparent layer on which using round (hardness 100) brush you can easily recreate all the colored balls.
Color picker and round brush, export to png. Compression level 1.

You should never upscale pixel graphics if you really don't have to, it blurs the image and will almost always lead to ugly outcome.
That's my pixel graphics rule #2.

And welcome to GimpChat.


Attachments:
Balls.png
Balls.png [ 74.81 KiB | Viewed 12416 times ]
Top
 Post subject: Re: Resize image without stretching
PostPosted: Mon Jan 07, 2019 6:40 am  (#7) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2438
Nidhogg very correct about upscaling this much degrading an image, might not be so bad for an animation. All in the eye-of-the beholder.

A tutorial for Gimp 2.10 - not much different from Gimp 2.8 - more ways than can be mentioned ;)

One way.

Image -> Scale image brings up this: Depends on the original image but a little calculation gives 360% as a value that gives the correct height but not width. You can do by trial-and-error or just setting the height in pixels, the width and height are linked so changing one value affects the other. Set the interpolation to NoHalo (or Sinc for Gimp 2.8) and click Scale.

Attachment:
01-resize.jpg
01-resize.jpg [ 84.38 KiB | Viewed 12410 times ]


To give a fit for the phone
Image -> Canvas size resizes without distorting the image. The essentials are: Set the width to the new size (2560) in pixels. Note the link between Width and Height is broken.Then click on center which gives a uniform offset, choose all layers and Foreground colour (black) (this is an improvement on Gimp 2.8 where you need to set the background swatch) Click on resize.

Attachment:
02-resize.jpg
02-resize.jpg [ 82.79 KiB | Viewed 12410 times ]


Guessing at least 22 images to adjust. The above can be applied in one go to an image with layers.
File -> Open as Layers to choose and open all of them.
Apply the above exactly in the same way.

To avoid having to export each layer individually an old Saul Goode script attached.
Unzip, goes in C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\scripts. Find it bottom of the File menu.

Actually you do not need to do this, Keep the layers and go straight to File -> Export. Export as an animated gif.

(Wonder if Gimp 2.10 webp animation format works with an Android phone?)


Edit: Shows how little I know about phone (hate them) a little look around and separate images needed https://forum.xda-developers.com/showth ... ?t=1852621

Maybe that old script will come in handy after all. Dump images in the Windows user folder As: https://i.imgur.com/woyODgM.jpg


Attachments:
sg-save-all-layers.scm.zip [2.03 KiB]
Downloaded 133 times

_________________
Image
Top
 Post subject: Re: Resize image without stretching
PostPosted: Mon Jan 07, 2019 1:48 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
If I'm interpreting your request right, you are looking for Liquid Rescale (Seam Carving). There is a GIMP filter for that but too lazy to look up where the download is (and have to get to work in a hour so about to chill). Below's a local search for it. :)

search.php?st=0&sk=t&sd=d&sr=posts&keywords=liquid+rescale

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Resize image without stretching
PostPosted: Tue Jan 08, 2019 1:52 am  (#9) 
Offline
New Member

Joined: Jan 06, 2019
Posts: 4
This is what I came up with after doing hours of scaling the images to 1440x900 and then adjusting the canvas size to 1440x2560. After that, I used the alignment tool to center it vertically. Then created a new layer to put behind it and colored it black with the paint bucket fill tool. I also learned how to make a gif with all the edited png files. It took me a few hours to manually edit all 207 png files that make up the gif/boot animation. Is there any way to streamline this process of converting small low-resolution png files to 1440x2560? It's a pain in the butt to do them all one by one lol.


Attachments:
File comment: Android Lolipop Boot Animation 1440x2560
Android_Lollipop_Boot_Animation.gif
Android_Lollipop_Boot_Animation.gif [ 4.1 MiB | Viewed 12341 times ]
Top
 Post subject: Re: Resize image without stretching
PostPosted: Tue Jan 08, 2019 3:45 am  (#10) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2438
Quote:
Is there any way to streamline this process of converting small low-resolution png files to 1440x2560? It's a pain in the butt to do them all one by one lol.


Gave more than a few hints in viewtopic.php?f=8&t=17132&sid=fa869bce62b714b5a890d9891c373791#p235109

A summary
Open all the files as layers File -> Open as Layers
Resize the image Image -> Resize
Then depends on the originals and some options
a) Resize the canvas as previously described.
b) If oversize crop (crop tool) the image to size
c) More advanced, Replace the background with a new image. There are scripts for this.

Working on a single image means minutes rather than hours of work.

_________________
Image


Top
 Post subject: Re: Resize image without stretching
PostPosted: Tue Jan 08, 2019 5:26 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
Alright, nice. Pulling out from head how I probably would try this with Gimp.
1. Create path for each ball.
2. Arakne follow path plugin for each ball separately. It includes some basic options, like percentual sizing.
3. Merge the four animation layers.
4. Black bg layer on bottom, combine layers with background (by saulgoode).

Btw, what's the idea of having 2560 pixels high gif?
I bet you can't see any difference if the resolution was half smaller on a few inch phone screen.


Top
 Post subject: Re: Resize image without stretching
PostPosted: Tue Jan 08, 2019 6:47 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jan 08, 2018
Posts: 101
Location: The Netherlands
Converseen is good software to resize batches of images.

_________________
Image


Top
 Post subject: Re: Resize image without stretching
PostPosted: Tue Jan 08, 2019 3:03 pm  (#13) 
Offline
New Member

Joined: Jan 06, 2019
Posts: 4
Nidhogg wrote:
Alright, nice. Pulling out from head how I probably would try this with Gimp.
1. Create path for each ball.
2. Arakne follow path plugin for each ball separately. It includes some basic options, like percentual sizing.
3. Merge the four animation layers.
4. Black bg layer on bottom, combine layers with background (by saulgoode).

Btw, what's the idea of having 2560 pixels high gif?
I bet you can't see any difference if the resolution was half smaller on a few inch phone screen.


From my limited understanding of boot animations, they have to match the resolution of the screen to fit it perfectly so it doesn't look funny. My particular phone which is an LG V20 has a screen resolution of 1440x2560. When I downloaded this boot animation it was too small and would make my screen glitch out upon booting. This is when I reached out to you guys here so that I could learn how to do this myself with gimp.


Top
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts How to resize image after "paste into selection"?

2

No new posts Attachment(s) Stretching text without blurr

4

No new posts Attachment(s) Can't resize brush

23

No new posts Attachment(s) [solved]quickly resize patterns

7

No new posts Retexture an image with another image as "Image Pattern" Plug-in

4



* Login  



Powered by phpBB3 © phpBB Group