Jump to content
How to Install Plugins ×

'Spirit Level' Photo Effect


Recommended Posts

 

'Spirit Level' Photo Effect Plugin

Summary

This Paint.NET effect plugin allows you to rotate a layer using a virtual spirit level. If you need to rotate an image then flatten it first. The rotation is limited to the range +/- 45°. This restriction allows the plugin to distinguish between horizontal and vertical leveling automatically.

Auto Scale modes allow you to define how the rotated layer will be scaled in the exiting image. Respect that the rotated image will be cropped to the current image dimension.

Padding modes define how areas uncovered after the rotation will be filled up. Padding does not have any effect to the rotated area itself. So a transparent area in the image will stay transparent.

If you need the rotated image in its rotated size (without scaling or cropping) then use the 'Copy' to clipboard command in the plugin, cancel the dialog, and execute Paint.NETs 'Paste into New Image' command. Or use 'Save As ...' to store the rotated image in a file.

 

SpiritLevel.Effect.Dialog.1.0.jpg

Keywords

Straighten, Rotate, Spirit Level, Plumb Bob, Horizontal, Vertical, Horizon

Author

Martin Osieka

Download >> SpiritLevel v1.0 (16.5.2015)

Installation

Follow the instructions carefully

  • Unzip "SpiritLevel.Effect vX.X.zip"
  • Copy the two files SpiritLevel.Effect.dll/.dlc to the Paint.NET\Effects\ folder
    .dll contains the module code
    .dlc contains the module configuration (like translated text)

After a restart of Paint.NET you will find the plugin at
    Menu->Effects->Photo->Rotate using a spirit level...
oder für deutsche Anwender unter
    Menu->Effekte->Foto->Rotieren mit Wasserwaage...

Compatibility

Paint.NET 3.5.11 and 4.0.5

Supported languages

The language used in the plugin depends on the language setting of Paint.NET and the support of this language by the plugin. The fallback is the first supported language of the plugin. Languages are defined in the .dlc files. This plugin supports the following languages in the moment:

  • English
  • Deutsch
  • русский (provided by ReMake)

You may add your own translation to the .dlc file.

Dialog options

Choose the object in the image you like to align horizontal or vertical by drawing a line to the image. After releasing the mouse button the image will be rotated so that the line is horizontal or vertical in the main canvas.
You may drag the start and end points of the line later to correct the position.
If the angle of the line you have drawn is less than +/- 45 degrees compared to a horizontal line then a horizontal leveling will be done else a vertical one.
Tip: The precision of the rotation depends on the length of the line. Longer is better in this case.

Auto scaling modes:
If you rotate an image then parts of the image will no longer be inside of the original image dimensions and other parts will be uncovered. A plugin can not change these dimensions but you can choose one of the auto scaling modes to define how the rotated image will fit into the original image.

  • Scale In: Increases the size of the image so that there are no uncovered areas
  • Off: No scaling
  • Scale Out: Decreases the size of the image so that there are no parts outside.

Padding modes:
If there are uncovered areas after the rotation then the padding mode defines how these areas will be filled.

  • Transparent
  • Primary color
  • Secondary color
  • Keep: The uncovered areas show the pixels of the original unrotated image
  • Mirror: Mirrors the rotated image at the borders. This provides the most natural effect on photos.

The basic user interface of the canvas will be explained in an other message.

Known issues

None

History

  • 1.0 (16.5.2015)
    - First release
  • Upvote 7

midoras signature.gif

Link to comment
Share on other sites

Overview: Scaling and padding modes

 

Starting image:

 

SpiritLevel.Effect.Dialog.jpg

 

 

Auto scale: Scale In; Padding Mode: Transparent and Mirror (no difference)

 

sunset%20AutoScaleIn.jpg  sunset%20AutoScaleIn%20PaddingMirror.jpg

 

Auto scale: Off; Padding Mode: Transparent and Mirror

 

sunset%20AutoScaleOff.jpg  sunset%20AutoScaleOff%20PaddingMirror.jp

 

Auto scale: Scale Out; Padding Mode: Transparent and Mirror

 

sunset%20AutoScaleOut.jpg  sunset%20AutoScaleOut%20PadiingMirror.jp

Edited by midora

midoras signature.gif

Link to comment
Share on other sites

Maimilian, Nitenurse, ReMake I hope you and others will find it usefull at some time.

Special thanks to ReMake who did the translation to русский.

 

Long work ended with a very good plugin.

 

This triggers me to provide a little bit statistic about the amount of work.

 

The c# source code is around 600kb or 14'000 lines of code. Just 3% of the code handles rotation, clipboard and file functions. The remaining part handles the User Interface. Around 70% precent of the code has been derived from other projects like the OptionBasedLibrary of PrintIt and the new code will be reintegrated to the code base. So hopefully most stuff can be reused in more sophisticated plugins.

 

Maybe these numbers give you an idea about the amount of work, Rick invested in Paint.NET over the years.

midoras signature.gif

Link to comment
Share on other sites

Long work - this is my assessment of all of the great work of the programmer from idea to realization of this idea. The numbers are impressive! I treat with understanding and respect for Rick, which alone continues this hard work. And let Paint.NET pleases its fans for many years.

Link to comment
Share on other sites

Long work - this is my assessment of all of the great work of the programmer from idea to realization of this idea.

 

Remake you got an important point. Software development is much more then coding. It's a must for developers to slip into the role of users and not vice versa.

 

 

Long live our coders and their invaluable efforts!! yes2.gifLaie_54.gifJC_ThankYou.gif

 

But only if there are users showing us their creativity.

midoras signature.gif

Link to comment
Share on other sites

78690.gif   Thank you @Midora for yet again making such a clever Plugin.  I will try not to embarrass myself when using it for the first time.  (Like I did with @BoltBait's :mrred:)

30b8T8B.gif

How I made Jennifer & Halle in Paint.net

My Gallery | My Deviant Art

"Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon.

 
Link to comment
Share on other sites

You never did Pixey. I may be a bit sensitive in this area ;-) When I constructed my house 4 years ago, we had to hammer 28 piles into the ground with an average length of 16m. Up to now the spirit level tells that everything is fine...

midoras signature.gif

Link to comment
Share on other sites

  • 2 weeks later...

Excellent plugin Midora! :star:

 

It took me a while to find it.  I was looking for an entry called "Spirit level" in the Photo submenu.  I think it would be better under this name than Rotate.....

  • Upvote 1
Link to comment
Share on other sites

Excellent plugin Midora! :star:

 

It took me a while to find it.  I was looking for an entry called "Spirit level" in the Photo submenu.  I think it would be better under this name than Rotate.....

 

You are right. If an effect has an explicit tool name (which you can remember) then you should use it at first.

 

In the meantime you may change the entry "SpiritLevelEffect=Rotate using a Spirit Level" in the .dlc file

  • Upvote 1

midoras signature.gif

Link to comment
Share on other sites

In the meantime you may change the entry "SpiritLevelEffect=Rotate using a Spirit Level" in the .dlc file

That's a neat trick! What a great idea.

Link to comment
Share on other sites

  • 2 years later...

Hi @Eli - I have put a Zip File in my drop box for you, but I think it's an old one.  Hopefully it will work:

 

https://www.dropbox.com/s/ldahass3rrvua0q/SpiritLevel.Effect v1.0.zip?dl=0

 

 

  • Like 2

30b8T8B.gif

How I made Jennifer & Halle in Paint.net

My Gallery | My Deviant Art

"Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon.

 
Link to comment
Share on other sites

I just tried it again myself, and it's working in the newest version of PDN :D.

 

Took me a bit to find it though. It's in Photo: and appears as 'Rotate using a Spirit Level'.

30b8T8B.gif

How I made Jennifer & Halle in Paint.net

My Gallery | My Deviant Art

"Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon.

 
Link to comment
Share on other sites

Added link to zipped DLL into first post.

Link to comment
Share on other sites

  • 6 years later...

@midora I think this plugin has stopped working (at least for me) after the last paint.net update.

Spoiler

File: C:\Program Files\paint.net\Effects\SpiritLevel.Effect.dll
Name: Effects.SpiritLevelEffect
Version: 1.0.0.40
Author: Martin Osieka
Copyright: © 2015, ComSquare AG, Switzerland
Website: http://forums.comsquare.ch/viewforum.php?title=Paint.NET Tools
Full error message: System.ArgumentException: An item with the same key has already been added. Key: D6, Control
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at ControlExtensions.AppCommands.Define(Enum commandId, String commandTextId, Keys commandKeys, Char commandCh, Image commandImage)
   at ControlExtensions.DocViewManager.CreateCommands(AppCommands commands, ResourceManager rm)
   at Effects.SpiritLevelDialog.CreateCommands()
   at Effects.SpiritLevelDialog..ctor(ControlContext context, String title)
   at Effects.SpiritLevelEffect.CreateConfigDialog()
   at PaintDotNet.Menus.EffectMenuBase.RunEffectImpl(EffectInfo effectInfo) in D:\src\pdn\src\PaintDotNet\Menus\EffectMenuBase.cs:line 959

 

 

welsh-Yellow-cheddar-cheese-signature.pn

Link to comment
Share on other sites

4 hours ago, Welsh Yellow Cheddar said:

@midora I think this plugin has stopped working (at least for me) after the last paint.net update.

  Reveal hidden contents

 

 

Yes, it's only compatible up to v4.0.5.

Until it's fixed, there is an alternative by @BoltBait called Level/Horizon Plumbob.

30b8T8B.gif

How I made Jennifer & Halle in Paint.net

My Gallery | My Deviant Art

"Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon.

 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...