Latest 0.2.7
Homepage https://github.com/LazyClutch/LCMosaicImageView
License MIT
Platforms ios 6.0, requires ARC
Frameworks UIKit, Foundation
Authors

Introduction

LCMosaicImageView is an image view which enables you to add mosaic effect on image or get mosaic copy of your image. You can use your finger to paint on the image, making partial mosaic effect on your touch area or directly call built-in API to get mosaic copy.

Features:

  • Paint on the image for partial mosaic effects.
  • Built-in API to get a whole mosaic image.
  • Easy to reset.
  • Different mosaic levels for different mosaic effects.
  • Different stroke scales for different painting area.
  • Easy to use, both for iPhone and iPad.

Overview

Paint on the image

paint

Reset to original status

reset

Get a whole mosaic image

oneclick

Different mosaic level

level

Different stroke scale

scale

Get Started

Installation

You can either use CocoaPods, adding pod 'LCMosaicImageView' in your podfile, or directly add LCMosaicImageView.h and LCMosaicImageView.m to your project.

Usage

  • Import header file

    #import <LCMosaicImageView/LCMosaicImageView.h>
  • Initialize LCMosaicImageView

    LCMosaicImageView *imageView = [[LCMosaicImageView alloc] initWithImage:YOUR_IMAGE];
    [self.view addSubview:imageView];
  • Switch on to enable paint event of imageView

    imageView.mosaicEnabled = YES;
  • (optional)Set mosaic level. A more mosaic level means that the image will get more blurred. If you don’t do that, the level will be set to LCMosaicLevelDefault

    imageView.mosaicLevel = LCMosaicLevelHigh;
  • (optional)Set stroke scale. A more stroke effect means that you will get a larger area for one stroke. If you don’t do that, the level will be set to LCStrokeScaleDefault

    imageView.strokeScale = LCStrokeScaleLarge;
  • (optional)Set delegate, you can set delegate to detect mosaic event.

    imageView.delegate = self;
  • Reset imageView to its original status;

    [imageView reset];
  • Get full mosaic image. You can achieve it by 2 instance methods and 2 class methods:

    - (UIImage *)mosaicImage;
    - (UIImage *)mosaicImageAtLevel:(LCMosaicLevel)level;
    + (UIImage *)mosaicImage:(UIImage *)image;
    + (UIImage *)mosaicImage:(UIImage *)image atLevel:(LCMosaicLevel)level;

Requirement

  • iOS 6.0+

License

LCMosaicImageView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "LCMosaicImageView",
    "version": "0.2.7",
    "license": "MIT",
    "summary": "An UIImageView enables you to add mosaic effect on image or get full mosaic image.",
    "homepage": "https://github.com/LazyClutch/LCMosaicImageView",
    "authors": {
        "Lazy Clutch": "[email protected]"
    },
    "source": {
        "git": "https://github.com/LazyClutch/LCMosaicImageView.git",
        "tag": "0.2.7"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source_files": "LCMosaicImageView/LCMosaicImageView.{h,m}",
    "frameworks": [
        "UIKit",
        "Foundation"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This