BoltBait

Lomography

30 posts in this topic

For info see this post:

Photo Manipulation: Lomography

For Paint.NET 3.x, Download this plugin here:

Lomography.zip

If you are using Paint.NET 4.0+, download here:

Lameography.zip

How to install plugins: http://www.boltbait.com/pdn/InstallingEffects.asp

If that doesn't work, post your troubles here: http://forums.getpaint.net/index.php?/forum/36-how-to-install-pluginsgeneral-plugin-troubleshooting/

Lomography.png

Updated CodeLab source code here:

 

// Title: BoltBait's Lameography v4.0
// Author: BoltBait
// Submenu: Photo
// Name: Lameography
// URL: http://www.BoltBait.com/pdn
#region UICode
int Amount1=-10; // [-100,100] Exposure
double Amount2=1; //[0,1] Hipster
#endregion

// Setup for using a specific pixel op
private UnaryPixelOps.Desaturate desaturateOp = new UnaryPixelOps.Desaturate();

// Setup for using a specific blend op
private UserBlendOps.NormalBlendOp normalOp = new UserBlendOps.NormalBlendOp();
private UserBlendOps.MultiplyBlendOp multiplyOp = new UserBlendOps.MultiplyBlendOp();

unsafe void Render(Surface dst, Surface src, Rectangle rect)
{
    Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
    int CenterX = ((selection.Right - selection.Left) / 2) + selection.Left;
    int CenterY = ((selection.Bottom - selection.Top) / 2) + selection.Top;
    int MaxWidth = (int)(((src.Width > src.Height)?src.Width:src.Height) * 1.2)/2;
    int MinWidth = (int)(((src.Width > src.Height)?src.Width:src.Height) * 0.5)/2;
    int barbieq25 = MaxWidth - MinWidth;

    // Setup for calling the Brightness and Contrast Adjustment function
    BrightnessAndContrastAdjustment bacAdjustment = new BrightnessAndContrastAdjustment();
    PropertyCollection bacProps = bacAdjustment.CreatePropertyCollection();
    PropertyBasedEffectConfigToken bacParameters = new PropertyBasedEffectConfigToken(bacProps);
    bacParameters.SetPropertyValue(BrightnessAndContrastAdjustment.PropertyNames.Brightness, Amount1);
    bacParameters.SetPropertyValue(BrightnessAndContrastAdjustment.PropertyNames.Contrast, 45);
    bacAdjustment.SetRenderInfo(bacParameters, new RenderArgs(dst), new RenderArgs(src));
    // Call the Brightness and Contrast Adjustment function
    bacAdjustment.Render(new Rectangle[1] {rect},0,1);

    // Now in the main render loop, the dst canvas has an adjusted version of the src canvas
    for (int y = rect.Top; y < rect.Bottom; y++)
    {
        if (IsCancelRequested) return;
        ColorBgra* srcPtr = src.GetPointAddressUnchecked(rect.Left, y);
        ColorBgra* dstPtr = dst.GetPointAddressUnchecked(rect.Left, y);
        for (int x = rect.Left; x < rect.Right; x++)
        {
            ColorBgra CurrentPixel = *dstPtr;

            int a = (int)Math.Abs(CenterX - x);
            int b = (int)Math.Abs(CenterY - y);
            // Remember the Distance Formula from high school geometry class?  Well, here it is...
            double c = Math.Sqrt( a*a + b*b );
            if (c > MaxWidth)
            {
                CurrentPixel = ColorBgra.Black;
                CurrentPixel.A = (byte)(255*Amount2);
            }
            else
            {
                if (c >= MinWidth)
                {
                    CurrentPixel = ColorBgra.Black;
                    // Remember PI from Algebra and Cosine from Algebra II?
                    CurrentPixel.A = (byte)((double)255*((-Math.Cos((c-MinWidth)/barbieq25 * Math.PI)+1)/2)*Amount2);
                }
                else
                {
                    CurrentPixel.A = 255;
                }
            }
            CurrentPixel = normalOp.Apply(*dstPtr, CurrentPixel);
            *dstPtr = CurrentPixel;

            // Now, let's make the picture moody...
            CurrentPixel = desaturateOp.Apply(CurrentPixel);
            *dstPtr = multiplyOp.Apply(*dstPtr, CurrentPixel);

            // And, we're ready for the next pixel.
            srcPtr++;
            dstPtr++;
        }
    }
}
Enjoy. B)beer.gif
0

Share this post


Link to post
Share on other sites

Yay, first to download and comment on it! :P

:o This plugin is great!! Thanks BB! Have a :mtdew: and chill for a bit.

0

Share this post


Link to post
Share on other sites

Heh. You offer me a :mtdew: when I already have a beer.gif ? :shock: :P

0

Share this post


Link to post
Share on other sites

Thanks for the automated process for my tutorial!

Heh. You offer me a :mtdew: when I already have a beer.gif ? :shock: :P

And BoltBait, my friend, that's called Alcoholic Dew!

0

Share this post


Link to post
Share on other sites

Do you people have a secret community for making plugins that do the work of a tutorial? :P

Thanks for the plugin BB, I liked the effect from the start

0

Share this post


Link to post
Share on other sites
Um does the Source Code work for others? I get some errors. (In Codelab)

I think BB was using a "newer" version of Codelab which he hasn't released yet :roll:

0

Share this post


Link to post
Share on other sites
Um does the Source Code work for others? I get some errors. (In Codelab)

I think BB was using a "newer" version of Codelab which he hasn't released yet :roll:

Yeah, sorry. I'm still working on CodeLab 1.3 and hopefully it will be released very soon.

Glad you all liked the plugin, though. All credit goes to the author of the original tutorial. 8)

0

Share this post


Link to post
Share on other sites
Not that it matters to me but,

Lomography is the commercial trademark of Lomographische AG

from: http://en.wikipedia.org/wiki/Lomography

I'll use it, thanks.

Perhaps I should change the name to "Lameography". What do you think...

0

Share this post


Link to post
Share on other sites

Great Plugin Boltbait, but the result is a little heavy dont you think, could you possibly adjust it (mabye i'm asking too much) so that the whole picture becomes really dark and hard to see. I'm forced to use the tutorial instead.

EDIT:

Great plugin.

Notice Simon Brown put in the ™ in his reply title. :wink:

How did you even notice that? :shock: :shock:

0

Share this post


Link to post
Share on other sites
How did you even notice that? :shock: :shock:

I tend to notice everything, especially ™ signs (which is kinda weird.) :mrgreen:

0

Share this post


Link to post
Share on other sites
How did you even notice that? :shock: :shock:

I tend to notice everything, especially ™ signs (which is kinda weird.) :mrgreen:

Lol i notice the green guy in your post title. :lol::lol:

Anymoney you just looked at my post title :)

0

Share this post


Link to post
Share on other sites

I knew I would finally use this. I used it on my album cover in the Alfredo section. NOW I UNDERSTAND IT ! Oh sorry I didn't mean to yell.

0

Share this post


Link to post
Share on other sites

May I ask why I cannot access the tutorial on how to create lomography effect anymore?

:( :( :(

0

Share this post


Link to post
Share on other sites

Would it possible to add an adjustment on the Vignette, Brightness and Saturation. As with some/most images, the effect is way too dark in the center. And, the Lomo cameras have a higher than normal saturation, not darker. That's why I think a Brightness adjustment is needed.

It can be adjusted with "Curves+", and the saturation can be adjusted with the Hue/Saturation+" dialog. But, it would be nice to have it one dialog, since PDN doesn't have a way to memorize multiple adjustments as a "preset"

Regards

Peter

0

Share this post


Link to post
Share on other sites

Would it possible to add an adjustment on the Vignette, Brightness and Saturation. As with some/most images, the effect is way too dark in the center. And, the Lomo cameras have a higher than normal saturation, not darker. That's why I think a Brightness adjustment is needed.

It can be adjusted with "Curves+", and the saturation can be adjusted with the Hue/Saturation+" dialog. But, it would be nice to have it one dialog, since PDN doesn't have a way to memorize multiple adjustments as a "preset"

Regards

Peter

I second this one.

Great plugin, though.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now