Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6 asset catalog automatically create images for smaller scales

With the need of 3x images in iOS 8 I figured it would be easier to manage images with an asset catalog in Xcode 6. I am trying to just provide a single image, the 3x scaled image to the asset catalog and I want Xcode to automatically downscale that image to generate 2x and 1x versions of the 3x image, so that I don't have to do it manually.

Right now this is what I have:

I really hope that Xcode has such a feature to automatically create 2x and 1x images and I just have not discovered it yet. If there isn't any such feature, are there any alternatives? (I know IconKit but it is annoying and hasn't been updated to support 3x images. If it was made properly in the first place it wouldn't even need an update..)

I know that Xcode automatically can generate all images from a vector pdf, but thats not what I am looking for!

like image 921
JonasG Avatar asked Sep 15 '14 02:09

JonasG


3 Answers

I ended up making a small mac app that takes care of the dirty work. You can drag and drop one or multiple .jpg or .png files into the app's main view; it will detect the input image's scale and create the smaller scaled images. With this app I only need to create a single, 3x image and drag it into the app to create the two smaller images. It saves so much work!

The source can be found on my GitHub page, simply download it and run it on your mac! https://github.com/JonasGessner/ImageReducer

like image 69
JonasG Avatar answered Oct 20 '22 06:10

JonasG


There is another way to solve this problem.

Use Automator to create Mac OS X service which create @3x, @2x and normal image on base of 1 image in @3x resolution automatically. It use just 3 methods: duplicate images, scale down, and rename.

Ready Mac OS X service made in Automator you can find here:

https://github.com/lukszar/iOS-Images-Prepare

like image 22
lukszar Avatar answered Oct 20 '22 05:10

lukszar


late to the party but there is one tool which make all assets @1x, @2x, @3x and icons for you in just one click. And also export to XCAssets file.

You can find it here: https://github.com/angelvasa/AVXCAssets-Generator

enter image description here

Hope this will help someone

like image 2
NSSwift Avatar answered Oct 20 '22 06:10

NSSwift