Code Monkey home page Code Monkey logo

Comments (6)

BradLarson avatar BradLarson commented on May 24, 2024

Good catch. For a two-pass filter like the edge detection and sketch filters, I was writing the first pass to disk, not the end result. That should now be fixed in the repository.

Thanks for pointing this out.

from gpuimage.

paulpilone avatar paulpilone commented on May 24, 2024

Thanks Brad. Pulled in the changes and looks great.

Thanks again for putting together this library. My experience in image processing/filtering is non-existent and this has been a great experiment in learning.

from gpuimage.

notsoux avatar notsoux commented on May 24, 2024

Hi!
Thanks for that great piece of software ;)!
I find it very helpful, expecially for me: I don't know anything about elaborating images and I was asked to add some effects to photo sharing app.

I've some problem and I think it can be something similar to the one discussed in this thread.

I have a problem with Sketch effects (and TiltShift too): when I apply Sketch effect on preview image it works really well, but when I use it on full size image (and save image data to file) it seems like just half effects was applied.

For example with Sketch effetc I got image without too much contrast (eg. the edge aren't very "dark").

Do you have some insights?

Thanks!

William

from gpuimage.

BradLarson avatar BradLarson commented on May 24, 2024

That's really a different issue. The sketch filter is based on edge detection routines. These are calculated based on neighboring pixels, so when you have a preview at a lower resolution the effect will be performed over a larger effective area in the image than when you capture a high-res still photo. You can control this to some degree by setting the texelWidth and texelHeight parameters of the filter to be 1/width and 1/height of the image size you start with. This will keep the edge detection calculations relatively constant.

The tilt shift filter is a different case, in that it uses a Gaussian blur. That blur is calculated based on local pixels, and again if you increase the image resolution it is now blurring over a smaller relative radius. You could try increasing the blurSize scaling value, but you will quickly see banding in that. I don't really have a good way of maintaining a constant image processing quality for this filter between images of various resolutions.

from gpuimage.

pednaa avatar pednaa commented on May 24, 2024

Has anyone come up with a solution to the Tilt Shift preview and final output not look the same?
I get a nice effect on the preview but the final captured image has a lot less effect to it.

from gpuimage.

BradLarson avatar BradLarson commented on May 24, 2024

@pednaa - This comment doesn't really have anything to do with this issue.

The reason for the difference in preview and photo appearance is that the Gaussian blur used for the out-of-focus section of the image is calculated based on neighboring pixels. The blur samples over a 9-pixel radius around each pixel, so for lower-resolution previews this blurs a larger region than in the high-resolution final image. You need to apply the blur over a larger number of pixels to achieve the same effect in the higher-resolution image.

Unfortunately, my blur filters are currently hardcoded to sample from a set number of pixels for performance reasons, and increasing the pixel spacing will introduce image artifacts. Multiple blur passes or a custom Gaussian blur that works over a larger radius would be needed here to achieve the same size of blur on a higher-resolution image.

from gpuimage.

Related Issues (20)

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.