Giter Club home page Giter Club logo

dlcimagepickercontroller's Introduction

About

DLCImagePickerController is a fast, beautiful and fun way to filter and capture your photos with OpenGL and your iPhone. The majority of the praise should be directed towards BradLarson for his GPUImage library.

To see the camera in action download Backspaces.

Setup

When you clone the repo, you'll need to download GPUImage assets:

git submodule init
git submodule update

Features

Live Filters

Here are some examples of the filters that are included. These are being applied to the live camera stream.

Filters

or check out on outdoor shoot with the old UI here

Radial Blur

It also has a radial blur, that you can move and pinch to your liking on the live view or captured image

Radial blur on and off

Front Facing Camera

There is a front facing camera

Front facing camera

Apply filters/blur after capture or retake photo

After you capture the image, you can apply new filters and toggle/move/resize the blur as you please or decide to retake it

Filters

Use an image from your camera roll

Import a picture from your camera roll and apply a filter/blur to it

Loaded from camera roll

Example output

These images were produced using the sample program included in this repo

Soft filter in nice daylight

High contrast black and white with radial blur

Contact

Dmitri Cherniak

Wylie Conlon

dlcimagepickercontroller's People

Contributors

dmitric avatar kgn avatar matej avatar nebiros avatar sujal avatar wylieconlon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dlcimagepickercontroller's Issues

Making Instagram like tilt-shift effect blur view.

how would i be able to modify the current radial blur to make it work like the Instagram tilt shift effect.

  1. I would need to use the GPUImageTiltShiftFilter.
  2. I would need to change the DLCBlurOverlayView to make the radius into a rotating rectangle.
    any help would be greatly appreciated.

Show with UIImage already in place

Hello, in my app I have a place where I choose between the camera and the imagepicker, so I'm hiding the imagepickerbutton in the DLCImagePickerController but there is no easy way to load the view with a UIImage already selected.

Blur issue in lanscape

After take a photo in landscape, then turn on blur, the blur position is incorrect, especially in the left bottom.

Create a new tag to update CocoaPods spec

Well, because you guys fix this bug in the master branch, would be nice if we can update the CocoaPod spec to a new version creating a new tag with this thing fixed.

012-08-22 13:41:27.291 DLCImagePickerController[759:907] Application windows are expected to have a root view controller at the end of application launch 2012-08-22 13:41:35.036 DLCImagePickerController[759:907] * Terminating app due to uncaught exception UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View <UIView: 0x1ed53f50; frame = (0 0; 320 480); autoresize = W+H; layer = <CALayer: 0x1ed53f20>> is associated with <UIViewController: 0x1ed53cb0>. Clear this association before associating this view with <DLCImagePickerController: 0x1edcd370>.'

BlurOverlayView. Need help to improve speed.

Hello,
Thanks for great sample how to use GPUImage. Could you tell me how to speed up BlurOverlayView? I know there is way to make it with UIScrollView. But could you show me how?

Thanks

Please add semantic version tags

I’ve recently added DLCImagePickerController to the CocoaPods package manager repo.

CocoaPods is a tool for managing dependencies for OSX and iOS Xcode projects and provides a central repository for iOS/OSX libraries. This makes adding libraries to a project and updating them extremely easy and it will help users to resolve dependencies of the libraries they use.

However, DLCImagePickerController doesn't have any version tags. I’ve added the current HEAD as version 0.0.1, but a version tag will make dependency resolution much easier.

Semantic version tags (instead of plain commit hashes/revisions) allow for resolution of cross-dependencies.

In case you didn’t know this yet; you can tag the current HEAD as, for instance, version 1.0.0, like so:

$ git tag -a 1.0.0 -m "Tag release 1.0.0"
$ git push --tags

iPad & iPhone 5 support

Any chance of making this awesome control work with the iPad? Theoretically if we size things using AutoLayout, then we'd get both iPad and iPhone 5 support all in one shot.

Memory Issue

Hey,

Thanks for this code !
I just have an memory issue... when I take a picture with ou without filter and I close the controller, dealloc is called but memory doesn't decrease and still stay at approx 70Mb.

Do you have this pb too ?

Thanks
Ben

Base SDK 6.1 casues shifting on iPhone 5 +

I downloaded the sample project and it works fine. However, if I change the Base SDK to 6.1, on only 4 inch(5, 5s, 5c) screen phones (not on simulator), when selecting a photo from the library, it shifts the the image to the left. For example, this is the original image when selecting from Library:
img_3098

after pressing choose:

img_0114

Notice how the image is shifted to the left with a black bard on the right. Any ideas/suggestions what could be wrong?

Thanks!

A view can only be associated with at most one view controller at a time!

Hey guys,

Running into an issue when trying to present the DLCImagePickerController. Strange thing is that it actually did work once but after that its continually hitting this error.

Im using cocoapods and xcode 4.6 if it helps.

Thanks!

2013-02-26 08:57:11.033 Noisy[4605:907] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View <UIView: 0x20905a70; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x20905a40>> is associated with <UIViewController: 0x20905700>. Clear this association before associating this view with <DLCImagePickerController: 0x1f5d0310>.'
*** First throw call stack:
(0x327693e7 0x3a45a963 0x32769307 0x345dcd53 0x345dcc47 0x32fd77d9 0x32fd3543 0x326ef8a5 0x34714e7d 0x347146ff 0x3460d079 0x34597451 0x34623357 0x34664cd9 0x34663fab 0x34785da3 0xe3e13 0xe3cc7 0x346cf9d9 0x34663087 0x3466303b 0x34663015 0x346628cb 0x34662db9 0x3458b5f9 0x345788e1 0x345781ef 0x3628f5f7 0x3628f227 0x3273e3e7 0x3273e38b 0x3273d20f 0x326b023d 0x326b00c9 0x3628e33b 0x345cc2b9 0xd80a1 0xd8028)
libc++abi.dylib: terminate called throwing an exception

Use output from -imageFromCurrentlyProcessedOutput to do filter previews after capture

Right now when we capture an image from the still camera, we grab the full resolution image and then apply the filters on the full resolution GPUImagePicture afterwards.

We should grab the preview from stillCamera using imageFromCurrentlyProcessedOutput with the cropFilter, apply filters on that, and then only render the full resolution image if the user clicks "Done."

This will speed up the processing on the live image, and will make the app more responsive.

I believe this should be used to do the capture from the front camera as well, and will probably fix issue #1

Blur overlay is a bit laggy on iPhone 4 and iPhone 4S

I've recently added in a radial gradient overlay to show the user where the blur is on the screen.
It's done using CoreGraphics and the code can be seen in the drawRect method of BlurOverlayView.m.

I've noticed it's a bit laggy on iPhone 4 and 4S, so if anyone with some CoreGraphics foo would mind helping out, I'd appreciate it.

gpuimage.h file not found

Hi,
I want to implement this type of code in my project its seems good..But while building it I'm getting gpuimage.h file not found error. So how can I solve it? Please help me.

iPhone 5 screen

Can someone make this Work with auto layout so that can work on iPhone 5 and iPhone4?

Can't apply LTU filters from GPUImage on Live Stream

Hi there. I've been using your code to learn Objective-C and so far so good. Wonderful work. The thing is I'm also using the GPUImage framework and each time I take a picture with the Amatorka filter on live stream I get a white image. The preview is fine, I mean, I take the picture and it shows up great on the App, I click done to save to camera roll and I get a white image. When I pick an image from the camera roll and apply the filter it works great, but not on live stream. All the other filters work great on live stream except the LTU filters (LookupFilter). Did I do something wrong, or is it just not possible to apply LTU filters to live stream. Thanks in advance.

ACV

How did you create the ACV files? And what exactly are they?

Edit: I wasn't able to set any labels on this for some reasons. It's more a question than an issue.

ARC Semantic Issues + Install instructions?

Hi,

This library is simply amazing, getting so much power with so little effort is a big gift for other developers hehe

First, is there any wiki page or install/usage instructions? How are we supposed to know what methods to use, etc?

I can't seem to compile anymore as I get lots of "ARC Semantic Issue" errors:

Any idea why I might be getting these? I installed via the podfile.

Thanks!

Blur does not work well

The blur filter does not follow when you move your finger, just do for taps.
Only follow when not took the picture.

Filter Button Customisation

Hello,
I have been using this fantastic library for a little over two month, and by this point I have fully implemented what I will need for my app. However, I was wondering if anyone knew how to add some more customisation to the UIButton's in the Scroll View, so that I can show names of the custom filters, and also how to add a border for the selected filter. I have attempted to do this for a few hours to no avail. Could anyone help with this?

Regards,
Christopher

Portrait picture aspect ratio / size

Hi there, thanks so much for your hard work! I noticed that pictures taken in portrait mode in DLCImagePickerController are "smaller" than portrait pics taken using the stock iPhone camera..Is this a bug? Do you have plans to make the output of your controller mirror that of the stock camera?

Thanks!

ios7 crash

hi, Unfortunately I discovered that the control crashes with ios 7: (

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Incomplete filter FBO: 36054'

the green indicator stop here:

dispatch_sync(videoProcessingQueue, block);

best regards :)

Lookup filters instead of ACV filters

I was wondering if it is possible to get the lookup filters working properly? They work on their own, but when you add the blur over it the image just goes black. The reason I want to use the lookup filters is that they allow more creative control over the kind of look I'm going for and anytime I made my own ACV filters and replaced yours or simply added them, they didn't work.

Any help would be greatly appreciated, and keep up the good work. I think you've got a great project here and I, as well as I'm sure many other people, am very thankful for everything you're doing.

Crash on IOS 5

I just tried your code, it crashes on simulator(Running IOS 5) as well as iPhone 4(Running IOS 6).
Reproducing steps,
Select Photo Picker, select any photo from library, selected 3rd Filter,(First and second are working fine), or any other next filter will crash the app.

Usage example?

Hi,

I'm currently playing with DLCImagePickerController and I have this code done:

/// .h
@interface CameraViewController : UIViewController<DLCImagePickerDelegate>
///

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.imagePicker = [[DLCImagePickerController alloc] init];
    [self presentViewController:self.imagePicker animated:true completion:nil];
}

- (void)imagePickerController:(DLCImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    [picker dismissViewControllerAnimated:true completion:nil];
    [self doneWithImage:[info objectForKey:@"UIImagePickerControllerOriginalImage"]];
}

- (void)imagePickerControllerDidCancel:(DLCImagePickerController *)picker
{
    NSLog(@"CANCEL");
}

None of the imagePickerController delegates method get called. When I press the X cancel button it does nothing and when I snap a picture and press done the button disables and I can only switch filters and do nothing else.

Is there anything I got wrong in my code? Is there any API docs or usage example for this project or not?

Thanks

Having difficulties with using images

Hello,

I am having difficulties to use images within the DLCImagePickerController. For example I am trying to add an image to filtersBackgroundImageView. There is no image showing. Can you please help me? Thanks..

    GPUImageOutput<GPUImageInput> *processUpTo;

    if (hasBlur) {
        processUpTo = blurFilter;
    } else {
        processUpTo = filter;
    }

    [staticPicture processImage];

    UIImage *currentFilteredVideoFrame = [processUpTo imageFromCurrentlyProcessedOutputWithOrientation:staticPictureOriginalOrientation];


    UIImageView *iv = [[UIImageView alloc] initWithFrame:CGRectMake(3, 3, 10, 10)];
    iv.image = [UIImage imageWithData:UIImageJPEGRepresentation(currentFilteredVideoFrame, self.outputJPEGQuality)];
    [self.filtersBackgroundImageView addSubview:iv];


    NSDictionary *info = [[NSDictionary alloc] initWithObjectsAndKeys:
                          UIImageJPEGRepresentation(currentFilteredVideoFrame, self.outputJPEGQuality), @"data", nil];
    [self.delegate imagePickerController:self didFinishPickingMediaWithInfo:info];

Adjust brightness using UISlider in Static Image.

Hi,

Is there a way we can adjust the brightness of the captured image using UISlider. Once you move the slider you can preview the brightness that will change. I have tried it using live view only. But i can't figure it out on the captured image. Hope you can help me on this.

Thanks!

Memory Warning and Crash

Hello, I am on a iPhone 4S, when I take a picture, I see a memory warning and when I try one or two filters my app crashes.
Everything works smoothly with the image picker

Solved the BlurOverlay lag and application on more complex filters

Hi @dmitric . I just solved the BlurOverlay lag and real-time application on more complex filters (such as GPUImageFilterGroup). How can I send you the code so you can try it and then implement it? I'm new to Github so I don't know how to make a Pull Request. I searched the documentation but it's not clear to me :-(

Thanks in advance.

I can compile DLCImagePicker project from my project, but can't compile the project itself

Hi,

I installed DLCImagePickerController, follow GPUImage instructions, etc.

It looks like this within my project:

When I select DLCImagePickerController as my target, it builds flawlessly.

I can #import <> the library but as soon as I try to alloc it I get this:

I know it's not a 100% related problem but mostly as project linking issue but I'd really need some help figuring this out. I've spent almost 2 days figuring it out and I'm still scratching my head on it.

If this can be of any help here's more screenshots:
Build Settings
Build Phases

Also any usage example anywhere? I'm sure it's simple enough but it'd be great to know what to look for when testing if the library is working.

Thanks a lot and have a nice day.

Error when switching to certain filters iOS6

I'm getting a error when switching between filters. It's referencing this line of code.

version = CFSwapInt16BigToHost((int)([databuffer bytes]));

Something appears to be wrong with all of the calls to the acv files.

Low photo quality

The image got from imagePickerController:didFinishPickingMediaWithInfo: is pixelated which result in a very low quality, and I already set the outputJPEGQuality = 1.0.

The original image is
2013-05-07 19 13 19

the result image is
2013-05-07 19 13 26

Thanks!!!

Get the filtered image back

Hello!

Just send a tweet asking this question. I'm working in an app that uses the picker to apply some filters to an image. What I want to do is to let the user save the filtered image afterwards. But I don't know how to extract the image from the GL Surface. Is it possible to generate an UIImage from the filtered one?

GPUImagePicture inherits from GPUImageOutput and checking its code:

- (UIImage *)imageFromCurrentlyProcessedOutputWithOrientation:(UIImageOrientation)imageOrientation;
{
    return nil;
}

- (UIImage *)imageByFilteringImage:(UIImage *)imageToFilter;
{
    return nil;
}

- (CGImageRef)newCGImageFromCurrentlyProcessedOutputWithOrientation:(UIImageOrientation)imageOrientation;
{
    return nil;
}

- (CGImageRef)newCGImageByFilteringImage:(UIImage *)imageToFilter;
{
    return nil;
}

It seems that is not possible, with this implementation...

Thanks!

blurring crashes on iOS6

Hi, great job!
But it seems that when you apply blur to a photo, then shoot, the program exits without any trace, even with Xcode.
Sorry about my poor English.

I'm using iOS6 with iPhone 4S

thank you very much about your great work!

Run camera with fullscreen

Is it possible to show fullscreen photo when I try to capture it? Now preview video is looks cropped. I want to stretch it to screen bounds. Here is screenshot of your example: https://a248.e.akamai.net/camo.github.com/283b7fe6757d1a14f408e95838b5b8b57c0a7f26/687474703a2f2f692e696d6775722e636f6d2f724a78316c2e706e67
I'm talking about this flag photo. I want to remove that tab controls at the bottom and top and make video preview fullscreen. If it's possible, how to do that?

Blur is applied multiple times on pan/pinch/toggling

Turn on blur and observe the effect. Then either toggle it on and off, or pan, or pinch. Observe that the blur "intensity" increases every time the event happens when the blur "intensity"/"level" should be constant, equal to the first time the blur is applied.

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.