Anteos
Global Moderator
Posts: 94
Joined: Mon May 08, 2017 11:59 am

Automated Screenshots and Icons Resizer

Sat May 13, 2017 9:33 am

This guide will help you resize pictures, such as your app's logo and screenshots, in various sizes, qualities and image types.

WHY WOULD YOU NEED IT?
Alternative Android stores ask for particular logo sizes that are not typical. For example, Amazon needs an 114.png logo, while Socio Store needs 72.png. Mobango only wants 480x800 screenshot, etc etc. However, even if you do not upload in such stores, you could still use a handy bulk image editing tool.

We are going to use a command line tool called ImageMagick which can really do wonders with image editing in bulk, but for this guide I will showcase only typical examples related to apps business.

1. Download ImageMagick here: https://www.imagemagick.org/script/download.php#windows
2. Create a folder somewhere in your system, rename it as Resizer, and put in there the imagemagick executable.
3. You will have to create a bat file in the same folder now.

HOW DOES THE BAT FILE LOOK LIKE
I will guide you through an actual setup scenario so we see what we have to write in that bat file.

Let's assume we have 4 screenhots with 800x1280 size and 4 screenshots with 1280x800 size. This is what we have actually taken ourselves from our app through the emulator or device. We also have our app's logo as 512x512 PNG.

What we need now is the same 4 shots converted to 480x800 and 800x480, 320x480, and our icon converted to many different smaller sizes.

Line which converts our 512x512 to 256x256 PNG file:
convert 512.png -resize 256x256! 256.png
Line which converts the 512x512 to 114x114:
convert 512.png -resize 114x114! 114.png
The exclamation point indicates we want the exact size, even if the original file is not fully square. That could cause distortion.

So, to cover up all our logo sizes, we would need these lines in the bat file:
convert 512.png -resize 256x256! 256.png
convert 512.png -resize 250x250! 250.png
convert 512.png -resize 300x300! 300.png
convert 512.png -resize 358x358! 358.png
convert 512.png -resize 200x200! 200.png
convert 512.png -resize 500x500! 500.png
convert 512.png -resize 212x212! 212.png
convert 512.png -resize 144x144! 144.png
convert 512.png -resize 100x100! 100.png
convert 512.png -resize 150x150! 150.png
convert 512.png -resize 114x114! 114.png
convert 512.png -resize 96x96! 96.png
convert 512.png -resize 72x72! 72.png
convert 512.png -resize 48x48! 48.png
convert 512.png -resize 36x36! 36.png


Prepare the Resizer folder

We create the following folders inside our "Resizer" folder:

820x1280 with our 4 portrait screenshots inside named as 1.jpg, 2.jpg, 3.jpg and 4.jpg
1280x800 with our 4 landscape screenshots inside named as 1.jpg, 2.jpg, 3.jpg and 4.jpg
480x800 folder which contains a folder named PNG
800x480 folder
320x480 folder

Line to convert the first screenshot in 820x1280 to 480x800 and put it in the 480x800 folder we created:
convert 800x1280/1.jpg -resize 480x800! 480x800/1.jpg
This line converts the shot to exact 480x800, distorting the image. If you exclude the exclamation point, you will get a file with dimensions close to 480x800, but not exactly 480x800, because the program would convert without distortion. App stores would not accept such shot.

Using the -quality [0-100] parameter you can lower quality to have a smaller file size:
convert 800x1280/1.jpg -quality 90 -resize 480x800! 480x800/1.jpg
Other useful parameter is the one which will help you crop images.

The following line is useful if you want a screenshot without the action bar and the bottom bar of the device (only the main screen of the device):
convert 800x1280/1.jpg -chop 0x44 -gravity South -chop 0x92 -quality 100 -resize 480x800! 480x800/1cropped.jpg
The numbers in the -chop parameter are the exact you need to chop away the top and bottom bar on a 800x1280 to 480x800 conversion.
You need to experiment to find out how to chop perfectly if your original shots are another size.

FINAL BAT FILE CONTENTS
The Final Contents of the bat file, for the mentioned scenario with 4 shots earlier:
convert 512.png -resize 256x256! 256.png
convert 512.png -resize 250x250! 250.png
convert 512.png -resize 300x300! 300.png
convert 512.png -resize 358x358! 358.png
convert 512.png -resize 200x200! 200.png
convert 512.png -resize 500x500! 500.png
convert 512.png -resize 212x212! 212.png
convert 512.png -resize 144x144! 144.png
convert 512.png -resize 100x100! 100.png
convert 512.png -resize 150x150! 150.png
convert 512.png -resize 114x114! 114.png
convert 512.png -resize 96x96! 96.png
convert 512.png -resize 72x72! 72.png
convert 512.png -resize 48x48! 48.png
convert 512.png -resize 36x36! 36.png
convert 512.png -quality 88 -resize 128x128! 128.jpg
convert 512.png -quality 88 -resize 64x64! 64.jpg
convert 512.png -quality 88 -resize 32x32! 32.jpg
convert 512.png -quality 88 -resize 16x16! 16.jpg

convert 1280x800/1.jpg -quality 100 -resize 800x480! 800x480/1.jpg
convert 1280x800/2.jpg -quality 100 -resize 800x480! 800x480/2.jpg
convert 1280x800/3.jpg -quality 100 -resize 800x480! 800x480/3.jpg
convert 1280x800/4.jpg -quality 100 -resize 800x480! 800x480/4.jpg

convert 800x1280/1.jpg -quality 98 -resize 480x800! 480x800/1.jpg
convert 800x1280/2.jpg -quality 98 -resize 480x800! 480x800/2.jpg
convert 800x1280/3.jpg -quality 98 -resize 480x800! 480x800/3.jpg
convert 800x1280/4.jpg -quality 98 -resize 480x800! 480x800/4.jpg

convert 800x1280/1.jpg -quality 100 -resize 320x480! 320x480/1.jpg
convert 800x1280/2.jpg -quality 100 -resize 320x480! 320x480/2.jpg
convert 800x1280/3.jpg -quality 100 -resize 320x480! 320x480/3.jpg
convert 800x1280/4.jpg -quality 100 -resize 320x480! 320x480/4.jpg

convert 480x800/1.jpg 480x800/PNG/1.png
convert 480x800/2.jpg 480x800/PNG/2.png
convert 480x800/3.jpg 480x800/PNG/3.png
convert 480x800/4.jpg 480x800/PNG/4.png
You simply need to run the bat file and the tool will start converting. It is fast, won't take more than 15 seconds.

Image

NOTES

Note 1: The tool is quite flexible. If a file is missing (for example you only have 3 shots, not 4) the tool will ignore the missing file and proceed.
Note 2: You will of course have to edit the code if you have different screenshots sizes, but it should be self-explanatory.
Note 3: You can check through the full documentation to expand the usage of your resizer into other kinds of bulk image editing:
https://www.imagemagick.org/script/comm ... essing.php

affiliatexx
ViP Blackhat
Posts: 13
Joined: Wed May 17, 2017 2:41 am

Re: Automated Screenshots and Icons Resizer

Fri May 19, 2017 7:38 pm

how do you get apps up on amazon? they always ban the account before any apps are even uploaded too it, it's worse then google play by a long shot

Anteos
Global Moderator
Posts: 94
Joined: Mon May 08, 2017 11:59 am

Re: Automated Screenshots and Icons Resizer

Sat May 20, 2017 5:37 am

affiliatexx wrote:
Fri May 19, 2017 7:38 pm
how do you get apps up on amazon? they always ban the account before any apps are even uploaded too it, it's worse then google play by a long shot
This is really surprising for me. I have 3 Amazon accounts, I have managed to have literally all kinds of apps accepted within 5hrs. The only apps that did not make it through were live wallpapers with extreme copyright usage ( Real Madrid, Barcelona even in the title). And then, I still get a message getting asked to submit proof of material usage rights. If I never submit, still OK. Account never gets banned there! I always thought it is against their policies, imagine :roll:

Even malware apps with out-of-app ads (even eomobi/hummermobi) they all made it through you know.

Maybe you had an account banned in the past and now they link your new accounts?

User avatar
jalu
Global Moderator
Posts: 79
Joined: Thu Jun 15, 2017 9:39 pm

Re: Automated Screenshots and Icons Resizer

Thu Jul 06, 2017 5:19 pm

Nice work, we use PHP to do this in a similar way.

Anteos
Global Moderator
Posts: 94
Joined: Mon May 08, 2017 11:59 am

Re: Automated Screenshots and Icons Resizer

Mon Jul 10, 2017 6:29 am

jalu wrote:
Thu Jul 06, 2017 5:19 pm
Nice work, we use PHP to do this in a similar way.
Great, well this should be easier to handle for someone like me without PHP experience :)

User avatar
jalu
Global Moderator
Posts: 79
Joined: Thu Jun 15, 2017 9:39 pm

Re: Automated Screenshots and Icons Resizer

Mon Jul 10, 2017 5:05 pm

If you need help, I can send you the PHP code, is very easy.

DeadMonkey
ViP Blackhat
Posts: 43
Joined: Mon Apr 24, 2017 5:28 am

Re: Automated Screenshots and Icons Resizer

Tue Aug 01, 2017 7:03 am

Guys, do you upload every possible screenshot versions on Google Play?
Or just phone screenshots?

Is it worth to prepare all screenshot size type for Google Play?

Anteos
Global Moderator
Posts: 94
Joined: Mon May 08, 2017 11:59 am

Re: Automated Screenshots and Icons Resizer

Tue Aug 01, 2017 8:54 am

DeadMonkey wrote:
Tue Aug 01, 2017 7:03 am
Guys, do you upload every possible screenshot versions on Google Play?
Or just phone screenshots?

Is it worth to prepare all screenshot size type for Google Play?
Of course it is worth it! If you do not put screenshots for tablet for example, the tablets cannot find your app from search.

Return to “Android Development”