Code Monkey home page Code Monkey logo

shadow-generator's Introduction

Shadow Generator

Shadow generator for your .png pictures. The utility was created to acheive the parallax effect, but you can use it whatever you would like to.

Parallax

What does it exactly do with my picture?

Process

  1. Gets your picture by drag'n'drop.
  2. Turns your picture to monochrome.
  3. Applies blur to the result.
  4. Saves this pretty cool shadow.

Where can I found the result?

The resulting shadows are placed near the original images with shadow suffix in filename.

What's special about filename?

Application is pretty intelligent with detecting picture's target device by its filename. So you can generate shadows for your original pictures and put them together to your app bundle. When you need to load your picture and shadow, you should look your app bundle for picture and picture-shadow. Automatic blur radius doubling provides equal results for retina and non-retina images.

How does it exactly work?

If the original filename includes @2x then shadow suffix will be added right before @2x. Additionaly you can double blur radius for that pictures simply checking checkbox.

For hero@2x.png the result filename is hero-shadow@2x.png

If the original filename includes ~ then shadow suffix will be added right before ~.

For hero~ipad.png the result filename is hero-shadow~ipad.png. But for hero@2x~ipad.png the result filename is hero-shadow@2x~ipad.png

In other cases shadow suffix will be appended to the filename.

For hero.png the result filename is hero-shadow.png

Why don't generate shadows at runtime?

You definitely should try this. You can use code from ShadowGenerator class to turn the resulting CGImageRef to representation you need with very little changes. The transformation code should work on both iOS and OS X.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.