morgen: Generate icon images for multiple platforms

Recommend this page to a friend!
  Info   Example   View files (9)   Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
80%Total: 207 All time: 8,220 This week: 306
Version License PHP version Categories
morgen 0.1MIT/X Consortium ...5.3PHP 5, Graphics
Description Author

This class can generate icons for multiple types of platforms.

It can take a XML configuration file with definitions of sizes and platforms that your Web application needs icons and images.

The class looks up another XML file that defines which types and sizes of images are necessary for each of the requested platforms that are supported.

Currently the configuration defines types and sizes of images for Android, iOS and Web platforms.

It can generate resized versions of the images in JPEG, PNG, GIF and SVG source files.

Innovation Award
PHP Programming Innovation award nominee
September 2016
Number 7


Prize: SourceGuarding PHP encoder tool
Developers that have tried to create applications that should run both on the Web, Android and iOS devices know that you need to have a different sets of application image icons that looks well on different resolutions.

This package provides a solution by automatically generating icon sets for different devices and sizes.

It supports generating icons from a SVG source graphics if you can run a program like Inkscape to convert images from SVG to the PNG format.

Manuel Lemos
Picture of Alexander Selifonov
  Performance   Level  
Name: Alexander Selifonov is available for providing paid consulting. Contact Alexander Selifonov .
Classes: 20 packages by
Country: Russian Federation Russian Federation
Age: 58
All time rank: 522 in Russian Federation Russian Federation
Week rank: 84 8 in Russian Federation Russian Federation
Innovation award
Innovation award
Nominee: 16x

Winner: 2x

Details

Morgen - Mobile Resource Generating

Short description

Android and iOS developers know that designing one icon set for their application is not enough: because of many device types and screen sizes they have to create resized pictire collections for many "resolutions". These sets should be placed in "resources" subfolders according to device types/display resolutions.

Android Studio has a special tools for dealing with them (Android media tools), some people use Photoshop/Illustrator scripts that automate creating icon sets for all resolutions. And there are a many other tools for that.

Here is a PHP solution. It can make resized versions for JPG, PNG, GIF source files.

If you have installed some SVG-to-PNG converter program (inkscape for example) that can work with command line parameters, Morgen can convert SVG files too (resized versions will be of PNG type).

Simple Using example

include_once('../src/morgen.php');

$generator = new \Morgen\IconGenerator();

// show full cmd line for your inkscape installation:
$generator->setSvgConvertor('D:/inkscape/inkscape.exe -z {from} -e {to}');

$options = array(
  'project' => 'project-greatApp.xml',
  'forced'  => false
);

$generator->createIconsFromImages($options);

Morgen can create all icon sets from a single media pack for all defined projects: for android version, for ios version, for web application etc. All you need is defining all "application types" in XML configuration file.

You will find default configuration file morgen.cfg.xml, that contains three "predefined" profiles (application types) for generated pictures: "android", "ios" and "webapp" (webapp is just a sample).

To change them or add your own ones, edit the global parameters in morgen.cfg.xml - it should be placed in the same folder with morgen.php module.

And you have to create definition XML file for each project, where you can choose desired application types, destination folders, used devices types, and selected files.

See a wiki for using details.

License

Distributed under MIT License MIT

  Files  
File Role Description
demo (2 files, 1 directory)
src (2 files)
LICENSE Lic. license
README.md Doc. Readme

  Files  /  demo  
File Role Description
media (3 files)
   morgen-demo.php Example demo script
   project-greatApp.xml Data Project definition example

  Files  /  demo  /  media  
File Role Description
   button-001.jpg Icon source image sample
   morgen.svg Data source image sample
   robot.png Data source image sample

  Files  /  src  
File Role Description
   morgen.cfg.xml Data Main configuration file
   morgen.php Class Main class module

 Version Control Unique User Downloads Download Rankings  
 100%
Total:207
This week:0
All time:8,220
This week:306
 User Ratings  
 
 All time
Utility:100%
Consistency:100%
Documentation:100%
Examples:100%
Tests:-
Videos:-
Overall:80%
Rank:24
  

For more information send a message to info at phpclasses dot org.