Latest 1.1.0
Homepage https://github.com/AdamStreet/UIImage-ASWhiteColorToAlpha
License MIT
Platforms ios , requires ARC
Authors

When do I need it?

This is our original image:

original

This is our background:

chessboard

We want this result:

white_color_to_alpha_on_chessboard

… which looks like this on white backgroud:

white_color_to_alpha_on_white

How it works?

  1. Copy the /UIImage_ASWhiteColorToAlpha directory into your project.

  2. Import UIImage+ASWhiteColorToAlpha.h #import UIImage+ASWhiteColorToAlpha.h

  3. Use -[UIImage imageWithWhiteColorToAlpha] method call to get your translucent image UIImage *myTranslucentImage = [myOriginalImage imageWithWhiteColorToAlpha]; or -[UIImage renderImageWithWhiteColorToAlpha:] which gives back the asynchronously rendered image in a completion block.
    __block UIImage *myTranslicentImage = nil; [myOriginalImage renderImageWithWhiteColorToAlpha:^(UIImage *translucentImage){ myTranslucentImage = translucentImage; // Update UI }];

Known issues

  • Should be cached for reuse

Latest podspec

{
    "name": "UIImage-ASWhiteColorToAlpha",
    "version": "1.1.0",
    "summary": "An easy image overlay creator that converts the white color to alpha.",
    "description": "# UIImage-ASWhiteColorToAlphann##When do I need it?nnThis is our original image:nn![original](https://raw.githubusercontent.com/AdamStreet/UIImage-ASWhiteColorToAlpha/master/Resources/original.png)nnThis is our background:nn![chessboard](https://raw.githubusercontent.com/AdamStreet/UIImage-ASWhiteColorToAlpha/master/Resources/chessboard_bg.png)nnWe want this result:nn![white_color_to_alpha_on_chessboard](https://raw.githubusercontent.com/AdamStreet/UIImage-ASWhiteColorToAlpha/master/Resources/white_color_to_alpha_on_chessboard.png)nn... which looks like this on white backgroud:nn![white_color_to_alpha_on_white](https://raw.githubusercontent.com/AdamStreet/UIImage-ASWhiteColorToAlpha/master/Resources/white_color_to_alpha_on_white.png)nn##How it works?nn1. Copy the `/UIImage_ASWhiteColorToAlpha` directory into your project.nn2. Import UIImage+ASWhiteColorToAlpha.h `#import UIImage+ASWhiteColorToAlpha.h`nn3. Use -[UIImage imageWithWhiteColorToAlpha] method call to get your translucent image `UIImage *myTranslucentImage = [myOriginalImage imageWithWhiteColorToAlpha];` or -[UIImage renderImageWithWhiteColorToAlpha:] which gives back the asynchronously rendered image in a completion block.n```__block UIImage *myTranslicentImage = nil;n[myOriginalImage renderImageWithWhiteColorToAlpha:^(UIImage *translucentImage){nmyTranslucentImage = translucentImage;n// Update UIn}];```nn##Known issuesnn* Should be cached for reuse",
    "homepage": "https://github.com/AdamStreet/UIImage-ASWhiteColorToAlpha",
    "screenshots": [
        "https://raw.githubusercontent.com/AdamStreet/UIImage-ASWhiteColorToAlpha/master/Resources/original.png",
        "https://raw.githubusercontent.com/AdamStreet/UIImage-ASWhiteColorToAlpha/master/Resources/chessboard_bg.png",
        "https://raw.githubusercontent.com/AdamStreet/UIImage-ASWhiteColorToAlpha/master/Resources/white_color_to_alpha_on_chessboard.png"
    ],
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Adam Szabo": "[email protected]"
    },
    "platforms": {
        "ios": null
    },
    "source": {
        "git": "https://github.com/AdamStreet/UIImage-ASWhiteColorToAlpha.git",
        "tag": "1.1.0"
    },
    "source_files": [
        "UIImage_ASWhiteColorToAlpha",
        "UIImage_ASWhiteColorToAlpha/**/*.{h,m}"
    ],
    "exclude_files": "UIImage_ASWhiteColorToAlpha/Exclude",
    "requires_arc": true
}

Pin It on Pinterest

Share This