BoltBait Posted November 27, 2015 Share Posted November 27, 2015 The main purpose of seam carving is to reduce the width (or height) of an image without scaling (squishing) the image. This effect calculates the line through your photograph with the least amount of changes and deletes that line shifting all pixels over to fill the gap. This is often called "content aware resizing". Use This effect is designed to be used with natural photographs. It is not designed to be used with an active selection. So, before running the effect, press Ctrl-D to remove any active selection. Run the effect and click the OK button. One line of your image will be removed. Note: Version 1.5 allows more than one line to be cut at a time. However, there is a limitation on how many lines can be safely cut at one time. You may find that only a few lines may be cut before you need to run the effect again so that more lines can be safely cut. Version 2.0 removes this limitation. Please be patient when carving more than a few lines at a time. Due to the nature of the algorithm, the entire effect is run in a single thread. So, it may take a few seconds for the effect to show up after you move the slider. If you wish to shrink your photograph even further, press Ctrl-F to redo the effect. Continue pressing Ctrl-F until your photograph is the desired size. Protecting Elements This effect will only carve out areas with full alpha. That is, it will ignore areas of your image where the alpha is set below 255. You can use this to your advantage by selecting any area you wish to protect then use the Adjustments > Transparency plugin to lower the transparency slightly. Once you've finished with all of your carving, use the Adjustments > Transparency plugin to restore your image to full opacity. Download (For paint.net 4.0.6+): http://forums.getpaint.net/index.php?/topic/32048-v You'll find it in your Effects > Photo > Seam Carving menu. NOTE: This is slow on camera sized images. Sliding the slider up to 200 could take a couple of minutes to see anything. This is all due to the fact that it is running the algorithm in a single thread. Updates v2.2 - Improved messaging. Added to my plugin pack. v2.1 - Memory usage cut in half, speed improved, messaging improved. v2.0 - Increases carves up to 200 lines at a time, removed "see it" option. v1.5 - Carve more than one line at a time. v1.1 - Fixed bug where it was producing jagged edges. v1.0 - Initial release. _________________ More info about seam carving here: https://en.wikipedia.org/wiki/Seam_carving _________________ 8 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
toe_head2001 Posted November 27, 2015 Share Posted November 27, 2015 I've tried it out on the example image from the Wikipedia page. It gave me a jagged edge. If you wish to shrink your photograph even further, press Ctrl-F to redo the effect. Continue pressing Ctrl-F until your photograph is the desired size. This seems rather silly. I don't think anyone would want to shrink their photo by only 1px, so why not make easier by adding a UI Control to iterate a loop? Granted you'd probably need to use a scratch surface, so it doesn't keep reading the same Source Surface every time. Then again, I haven't seen your source code, or so I could be dead wrong. Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
BoltBait Posted November 27, 2015 Author Share Posted November 27, 2015 I've tried it out on the example image from the Wikipedia page. It gave me a jagged edge. Yup. That's a bug. I'll work on a fix. This seems rather silly. I don't think anyone would want to shrink their photo by only 1px, so why not make easier by adding a UI Control to iterate a loop? Granted you'd probably need to use a scratch surface, so it doesn't keep reading the same Source Surface every time. Then again, I haven't seen your source code, or so I could be dead wrong. The idea is to keep the UI as simple as possible while I work the bugs out of the algorithm. Once the algorithm is solid, I'll see about improving the UI. In the mean time, I think I'll move this thread to the development section. 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
BoltBait Posted November 27, 2015 Author Share Posted November 27, 2015 Ok, I think I fixed that bug. It seems fairly solid now, so... moving back. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
toe_head2001 Posted November 27, 2015 Share Posted November 27, 2015 Ok, I think I fixed that bug. It seems fairly solid now, so... moving back. I just ran it on a few images real quick. Looks good. 1 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
skullbonz Posted November 27, 2015 Share Posted November 27, 2015 I have read this post over and over and can not see what this would be used for. What am I missing? Quote http://forums.getpaint.net/index.php?/topic/21233-skullbonz-art-gallery Link to comment Share on other sites More sharing options...
BoltBait Posted November 27, 2015 Author Share Posted November 27, 2015 I have read this post over and over and can not see what this would be used for. What am I missing? Read this: https://en.wikipedia.org/wiki/Seam_carving Look at the images along the right hand side of the page. The main purpose of seam carving is to reduce the width (or height) of an image without scaling (squishing) the image. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
skullbonz Posted November 27, 2015 Share Posted November 27, 2015 Ok, I see now. So does the plugin make the seams itself or do you draw the seams in? Quote http://forums.getpaint.net/index.php?/topic/21233-skullbonz-art-gallery Link to comment Share on other sites More sharing options...
lynxster4 Posted November 27, 2015 Share Posted November 27, 2015 I can see this plugin as being very useful on certain photographs. Thank you, BoltBait. Quote My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer" Link to comment Share on other sites More sharing options...
BoltBait Posted November 27, 2015 Author Share Posted November 27, 2015 Ok, I see now. So does the plugin make the seams itself or do you draw the seams in? The plugin determines the best seam and then cuts it out automatically. You can protect certain areas of your photograph (described above) or just let the plugin do its best guess. It has a checkbox that you can use to see the seam it determines. This is purely to satisfy your curiosity. You would never select that option when using the plugin to carve a photograph. EDIT: This option has been removed in version 2.0. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
racerx Posted November 27, 2015 Share Posted November 27, 2015 OK, let me start by saying that I really do appreciate and like your PDN plugins very much. I also have tested a few "Content aware resize filters" in various programs, to be truthful, I'm not sold on the merits of this type of filter. This one is a real head scratcher though. Is it not possible to just enter a horizontal and vertical resize dimension and be done with it? Quote Link to comment Share on other sites More sharing options...
BoltBait Posted November 27, 2015 Author Share Posted November 27, 2015 OK, let me start by saying that I really do appreciate and like your PDN plugins very much. I also have tested a few "Content aware resize filters" in various programs, to be truthful, I'm not sold on the merits of this type of filter. This one is a real head scratcher though. Is it not possible to just enter a horizontal and vertical resize dimension and be done with it? As stated above... This seems rather silly. I don't think anyone would want to shrink their photo by only 1px, so why not make easier by adding a UI Control to iterate a loop? Granted you'd probably need to use a scratch surface, so it doesn't keep reading the same Source Surface every time. Then again, I haven't seen your source code, or so I could be dead wrong. The idea is to keep the UI as simple as possible while I work the bugs out of the algorithm. Once the algorithm is solid, I'll see about improving the UI. But, even as limited as the UI is right now, Ctrl-F makes this plugin really useful. EDIT: UI has been fixed in version 2.0. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
BoltBait Posted November 29, 2015 Author Share Posted November 29, 2015 OK, I have updated this plugin to version 1.5 to allow more than one line to be cut at one time. The algorithm calculates all the safe lines through your photograph (x lines), then allows you to cut 1-x lines. The number of lines you may cut at one time may be small. That's OK. Just cut them and run the effect again to calculate the next set of lines that can be safely cut. (You may move the slider all the way to to the left to cut maximum lines and press Ctrl-F to do it again.) I know you may be disappointed that you can't shrink the image all the way in one run, but, after cutting some lines, it is necessary for the algorithm to start over. This ensures the highest quality of the resulting image. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
toe_head2001 Posted November 29, 2015 Share Posted November 29, 2015 Jagged edge again.I suspect this is the cause? Intersecting/merged cuts. I know you may be disappointed that you can't shrink the image all the way in one run, but, after cutting some lines, it is necessary for the algorithm to start over. This ensures the highest quality of the resulting image. This may be a dumb question. I understand it would not work if you were to read from the same Source Surface every time, but couldn't you use a scratch surface to get around this? 1) copy the Source Surface to a scratch surface when the effect opens 2) read the scratch surface to see where cuts can be made 3) write the cut image to the scratch surface 4) go to step 2 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
BoltBait Posted November 29, 2015 Author Share Posted November 29, 2015 The only time I've seen these jagged edges is when I rendered the purple lines on an image and then ran it again to cut them out. Looks like I'm going to have to rewrite this effect from scratch. And, this time I'll use a temporary surface. 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
BoltBait Posted November 29, 2015 Author Share Posted November 29, 2015 Looks like I'm going to have to rewrite this effect from scratch. And, this time I'll use a temporary surface. Complete rewrite done. Version 2.0 has been posted. Due to the nature of the new algorithm, the "see it" option had to be removed. The new algorithm is iterative in nature, so the seams cut (after the first one) may not have existed in the original photograph. 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
BoltBait Posted December 1, 2015 Author Share Posted December 1, 2015 Version 2.1 published. Improvements: Memory usage cut in half, speed improved, messaging improved. This is just about ready to add to the plugin pack. 5 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Seerose Posted December 1, 2015 Share Posted December 1, 2015 Thank you Mister BoltBait! Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi Link to comment Share on other sites More sharing options...
david.atwell Posted December 2, 2015 Share Posted December 2, 2015 OK, let me start by saying that I really do appreciate and like your PDN plugins very much. I also have tested a few "Content aware resize filters" in various programs, to be truthful, I'm not sold on the merits of this type of filter.It allows you to resize the image significantly while keeping the subject and other objects in the image at full size within the frame. It's actually very useful. Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. Link to comment Share on other sites More sharing options...
skullbonz Posted December 5, 2015 Share Posted December 5, 2015 I like this plugin, real cool BoltBait. It serves the purpose real well, great job. Here is my first try at it. 1 Quote http://forums.getpaint.net/index.php?/topic/21233-skullbonz-art-gallery Link to comment Share on other sites More sharing options...
a4955 Posted April 10, 2018 Share Posted April 10, 2018 I've just tried using this with version 4.0.21 and while the horizontal one works (albeit it being a bit annoying it can only go at 200 at time but understandable), the vertical one crashes paint.net immediately upon clicking it. I've attached a crash report. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted April 11, 2018 Author Share Posted April 11, 2018 2 hours ago, a4955 said: I've just tried using this with version 4.0.21 and while the horizontal one works (albeit it being a bit annoying it can only go at 200 at time but understandable), the vertical one crashes paint.net immediately upon clicking it. I've attached a crash report. Thanks for the crash report. I'll take a look and see what's going on. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
nabsltd Posted May 3, 2018 Share Posted May 3, 2018 I've searched on the plugin index but can't find anything like this plugin that can add pixels like the demo on the Wikipedia page. Have I just not searched correctly, or is there nothing that can increase the size of an image with the same seam algorithm? Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted May 3, 2018 Share Posted May 3, 2018 Content aware fill has just been released, try that: Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.