BoltBait 2,601 Report post Posted September 12, 2008 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: https://boltbait.com/pdn/InstallingEffects.php If that doesn't work, post your troubles here: http://forums.getpaint.net/index.php?/forum/36-how-to-install-pluginsgeneral-plugin-troubleshooting/ 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. Quote Share this post Link to post Share on other sites
LFC4EVER 4 Report post Posted September 12, 2008 Yay, first to download and comment on it! :o This plugin is great!! Thanks BB! Have a and chill for a bit. Quote Share this post Link to post Share on other sites
BoltBait 2,601 Report post Posted September 12, 2008 Heh. You offer me a when I already have a ? :shock: Quote Share this post Link to post Share on other sites
Ash 10 Report post Posted September 13, 2008 Thanks! Quote Share this post Link to post Share on other sites
heythere 0 Report post Posted September 13, 2008 Um does the Source Code work for others? I get some errors. (In Codelab) Quote Share this post Link to post Share on other sites
Code_Ember 0 Report post Posted September 13, 2008 Thanks for the automated process for my tutorial! Heh. You offer me a when I already have a ? :shock: And BoltBait, my friend, that's called Alcoholic Dew! Quote Share this post Link to post Share on other sites
D3z 0 Report post Posted September 13, 2008 Do you people have a secret community for making plugins that do the work of a tutorial? Thanks for the plugin BB, I liked the effect from the start Quote Share this post Link to post Share on other sites
Andrew D 1 Report post Posted September 13, 2008 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 Quote Share this post Link to post Share on other sites
Blooper 0 Report post Posted September 13, 2008 DLing. But the kitty has part of his ear missing Quote Share this post Link to post Share on other sites
BoltBait 2,601 Report post Posted September 14, 2008 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 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) Quote Share this post Link to post Share on other sites
UnforGiven 0 Report post Posted September 28, 2008 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. Quote Share this post Link to post Share on other sites
Simon Brown 41 Report post Posted September 28, 2008 Great plugin. Quote Share this post Link to post Share on other sites
heythere 0 Report post Posted September 28, 2008 Great plugin. Notice Simon Brown put in the ™ in his reply title. :wink: Quote Share this post Link to post Share on other sites
BoltBait 2,601 Report post Posted September 28, 2008 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... Quote Share this post Link to post Share on other sites
heythere 0 Report post Posted September 28, 2008 Hope you aren't trying to imply that it's lame. :? Quote Share this post Link to post Share on other sites
LJXD 0 Report post Posted September 30, 2008 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: Quote Share this post Link to post Share on other sites
heythere 0 Report post Posted September 30, 2008 How did you even notice that? :shock: :shock: I tend to notice everything, especially ™ signs (which is kinda weird.) Quote Share this post Link to post Share on other sites
crimsonsorrow 0 Report post Posted October 5, 2008 first added glow and then lomography. awesome effect to mess with! Quote Share this post Link to post Share on other sites
LJXD 0 Report post Posted October 13, 2008 How did you even notice that? :shock: :shock: I tend to notice everything, especially ™ signs (which is kinda weird.) Lol i notice the green guy in your post title. Anymoney you just looked at my post title Quote Share this post Link to post Share on other sites
Possum Roadkill 7 Report post Posted May 16, 2009 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. Quote Share this post Link to post Share on other sites
Remii9512 0 Report post Posted September 16, 2009 Awesomeness. makes an epic effect, keep it up! Quote Share this post Link to post Share on other sites
crappy 0 Report post Posted October 25, 2009 May I ask why I cannot access the tutorial on how to create lomography effect anymore? :( Quote Share this post Link to post Share on other sites
Frontcannon 7 Report post Posted October 25, 2009 That's a legacy tut, ask a mod if you want to see it again. Quote Share this post Link to post Share on other sites
arbib 0 Report post Posted May 28, 2011 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 Quote Share this post Link to post Share on other sites
effemmeffe 0 Report post Posted June 7, 2011 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. Quote Share this post Link to post Share on other sites