Martin Osieka

'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

Share this post


Link to post
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 Martin Osieka

Share this post


Link to post
Share on other sites

Congrats on the first official release of a really nice plugin! And also thanks for the 3.5.11 compatibility! appl.gif

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Looks good! ;)

I will give this a try as works on both 3.5.11 & 4.x

The statistics about the amount of work are mind-boggling!

Many Thanks!

Share this post


Link to post
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.

Share this post


Link to post
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:)

Share this post


Link to post
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...

Share this post


Link to post
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.....

  • Upvote 1

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Does anyone have this effect? I can not dowload it. Martin Osieka has not been on the forum for a while and the website where he hosts his files has been down for some time already.

Share this post


Link to post
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'.

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