To give you an ad-free browsing experience, this website is completely funded by donations. If you use the information in this article to solve a problem, entertain yourself, or otherwise improve your life, please consider a small donation to help pay for server costs. Many thanks, and enjoy the site!

Graphics Code

Real-time Image Curves (using cubic splines) in VB6

By request, here is the first of its kind in VB: a fast, accurate, real-time image curves dialog.  (This should be familiar to any PhotoShop users out there :)  Curves is similar in theory both “Image Levels” post and standard gamma correction, but it provides a much more powerful interface for adjusting the luminance of an image.  This project provides results very similar to Photoshop’s, and it allows the creation of more spline knots (32 instead of 16).  The cubic spline code on which I based my code was taken from Jason Bullen’s excellent “Simple Cubic Spline Curve Plot” (available at Planet Source Code).

The code is well-commented and very fast – please post comments, requests for future Photoshop-related code, and many heaps of praise (as this was a complicated routine to sort out…)!

Download Code (85 kb)

Believe it or not, this is a legitimate real-life application of calculus.  Who would've thought it possible?

Believe it or not, this is a legitimate real-life application of calculus. You don't see that every day.

 

BSD License
All source code in the above zip file has been released under a BSD License.

 

Related articles:

Discussion (Oldest Comments Displayed First)

Be the first to comment on “Real-time Image Curves (using cubic splines) in VB6”

Post a comment

Feel free to use any of these tags in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>