Jump to content


Photo

Lomography


29 replies to this topic

#1 BoltBait

BoltBait

    2013 Movie Guru Award Winner

  • Administrators
  • 9,487 posts
  • LocationCalifornia, USA
  • Reputation:257

Posted 12 September 2008 - 11:01 PM

For info see this post:

Photo Manipulation: Lomography

For Paint.NET 3.x, Download this plugin here:
Attached File  Lomography.zip   5.42KB   2223 downloads

If you are using Paint.NET 4.0+, download here:
Attached File  Lameography.zip   4.91KB   160 downloads

How to install plugins: http://www.boltbait....lingEffects.asp

If that doesn't work, post your troubles here: http://forums.getpai...roubleshooting/

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
Click to play:
Posted ImagePosted ImagePosted ImagePosted ImagePosted Image
Download: BoltBait's Plugin Pack | CodeLab | More... and how about a Computer Dominos Game

#2 LFC4EVER

LFC4EVER
  • Members
  • 2,537 posts
  • LocationEngland, Earth, The Universe
  • Reputation:2

Posted 12 September 2008 - 11:07 PM

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

Merry Christmas

Posted Image
.::.My Gallery.::.Make Gold Text!.::.


#3 BoltBait

BoltBait

    2013 Movie Guru Award Winner

  • Administrators
  • 9,487 posts
  • LocationCalifornia, USA
  • Reputation:257

Posted 12 September 2008 - 11:49 PM

Heh. You offer me a :mtdew: when I already have a Posted Image ? :shock: :P
  • 0
Click to play:
Posted ImagePosted ImagePosted ImagePosted ImagePosted Image
Download: BoltBait's Plugin Pack | CodeLab | More... and how about a Computer Dominos Game

#4 Ash

Ash

    Former Moderator

  • Members
  • 6,381 posts
  • Locationhttp://tinyurl.com/6kqz9v
  • Reputation:7

Posted 13 September 2008 - 12:13 AM

Thanks!
  • 0

Posted Image
All creations Ash + Paint.NET [ Googlepage | deviantArt | Club PDN | PDN Fan ]


#5 heythere

heythere
  • Members
  • 103 posts
  • Reputation:0

Posted 13 September 2008 - 01:53 AM

Um does the Source Code work for others? I get some errors. (In Codelab)
  • 0

#6 Code_Ember

Code_Ember

    2008 "Hit-And-Miss" Award Winner. Rest in peace.

  • Members
  • 141 posts
  • Reputation:0

Posted 13 September 2008 - 12:10 PM

Thanks for the automated process for my tutorial!

Heh. You offer me a :mtdew: when I already have a Posted Image ? :shock: :P



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

Posted Image


Code_Ember passed away on October 25, 2008. The Paint.NET forum staff and members wish his family and friends only the best in this difficult time.


#7 D3z

D3z
  • Members
  • 230 posts
  • LocationSouth Africa
  • Reputation:0

Posted 13 September 2008 - 02:09 PM

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
Posted Image
"Confusion is the welcome mat at the door of creativity." -Michaul Gelb
My Gallery Check it out!

#8 Andrew D

Andrew D
  • Members
  • 2,238 posts
  • Reputation:0

Posted 13 September 2008 - 07:43 PM

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

Posted Image


#9 Blooper

Blooper
  • Members
  • 2,102 posts
  • Reputation:0

Posted 13 September 2008 - 07:50 PM

DLing. But the kitty has part of his ear missing :cry:
  • 0

#10 BoltBait

BoltBait

    2013 Movie Guru Award Winner

  • Administrators
  • 9,487 posts
  • LocationCalifornia, USA
  • Reputation:257

Posted 14 September 2008 - 09:48 PM

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
Click to play:
Posted ImagePosted ImagePosted ImagePosted ImagePosted Image
Download: BoltBait's Plugin Pack | CodeLab | More... and how about a Computer Dominos Game

#11 UnforGiven

UnforGiven
  • Members
  • 34 posts
  • Reputation:0

Posted 28 September 2008 - 12:29 AM

Not that it matters to me but,
Lomography is the commercial trademark of Lomographische AG
from: http://en.wikipedia....wiki/Lomography
I'll use it, thanks.
  • 0
Posted Image

#12 Simon Brown

Simon Brown
  • Members
  • 10,251 posts
  • Reputation:26

Posted 28 September 2008 - 12:35 AM

Great plugin.
  • 0
Posted Image

#13 heythere

heythere
  • Members
  • 103 posts
  • Reputation:0

Posted 28 September 2008 - 01:29 AM

Great plugin.


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

#14 BoltBait

BoltBait

    2013 Movie Guru Award Winner

  • Administrators
  • 9,487 posts
  • LocationCalifornia, USA
  • Reputation:257

Posted 28 September 2008 - 02:38 AM

Not that it matters to me but,
Lomography is the commercial trademark of Lomographische AG
from: http://en.wikipedia....wiki/Lomography
I'll use it, thanks.

Perhaps I should change the name to "Lameography". What do you think...
  • 0
Click to play:
Posted ImagePosted ImagePosted ImagePosted ImagePosted Image
Download: BoltBait's Plugin Pack | CodeLab | More... and how about a Computer Dominos Game

#15 heythere

heythere
  • Members
  • 103 posts
  • Reputation:0

Posted 28 September 2008 - 03:26 AM

Hope you aren't trying to imply that it's lame. :?
  • 0

#16 LJXD

LJXD
  • Members
  • 891 posts
  • LocationSpringfield
  • Reputation:0

Posted 30 September 2008 - 06:52 AM

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

#17 heythere

heythere
  • Members
  • 103 posts
  • Reputation:0

Posted 30 September 2008 - 11:19 AM

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


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

#18 crimsonsorrow

crimsonsorrow
  • Members
  • 44 posts
  • Locationv-town in the bay area, CALI
  • Reputation:0

Posted 05 October 2008 - 11:39 PM

first added glow and then lomography. awesome effect to mess with!

Posted Image
  • 0

#19 LJXD

LJXD
  • Members
  • 891 posts
  • LocationSpringfield
  • Reputation:0

Posted 13 October 2008 - 08:02 AM

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

#20 Possum Roadkill

Possum Roadkill
  • Competition Hosts
  • 2,051 posts
  • LocationHenry County Indiana USA
  • Reputation:7

Posted 16 May 2009 - 01:37 AM

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

Posted Image

My Gallery

SAC, WOTW and Photo Manip Competition Host
To visit the Comps click HERE