sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] ImageTrimmer

    Scheduled Pinned Locked Moved Plugins
    364 Posts 58 Posters 228.2k Views 58 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • unclebimU Offline
      unclebim
      last edited by

      fwpatcherPatchSuccessful.png

      Thank you TIG and davidlouis!

      1 Reply Last reply Reply Quote 0
      • L Offline
        ledisnomad
        last edited by

        I just found this magnificent plugin, exactly what I was looking for! Unfortunately, I do not and cannot have administrator access to anything on my Windows 7 work computer. Not to mention I don't have Java on it and am not allowed to install it. 😞

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          @ledisnomad said:

          I just found this magnificent plugin, exactly what I was looking for! Unfortunately, I do not and cannot have administrator access to anything on my Windows 7 work computer. Not to mention I don't have Java on it and am not allowed to install it. 😞

          If you can't have Java installed you are knacked!
          If you could have Java working there are work-around to get the tools loading/running from a 'personal directory' - your IT guys would need to allow a small ruby to run from their side to let your personal files' load...
          BUT without Java the SKM tools can't function...
          So the only solution is to do it at home and bring it in - thereby shaming your office into dragging themselves into the 21st century ! 😕

          Alternatively send [email/PM] me the PNG images and I'll email/PM the cutout SKP back to you within 12hours at $20 each [Pre-PayPalled] ??? 😄

          TIG

          1 Reply Last reply Reply Quote 0
          • L Offline
            ledisnomad
            last edited by

            Thanks for the response, TIG. Always quick and helpful. I'll see if I can convince IT to install Java and give me appropriate rights. No matter how many sources of 2d and 3d people, trees, furniture, cars, backgrounds, textures, etc, I always seem to need/want to find/make some more...

            1 Reply Last reply Reply Quote 0
            • srxS Offline
              srx
              last edited by

              First thanks TIG for one more wonderful plugin. I tried to use it to make some face me components of trees, but for me it was painful slow...I read earlier in this topic that the best thing to do is to make smaller image. I could do that, but I want best resolution SU can handle. So, what I have in mind is - could U make this internal process? I mean, first scale down the image, than the rest of code, than brings back original resolution, all by plugin?

              www.saurus.rs

              1 Reply Last reply Reply Quote 0
              • charly2008C Offline
                charly2008
                last edited by

                Hi,

                for this workflow I have used a very time-consuming method in the past. I have vectorized the "PNG", using an external application and than imported the "DXF" into Sketchup than I erased manually all unwanted edges.

                The "TIG" tool seems to be a great tool for this purpose. I've just now taken notice of it. But unfortunately it does not seem to work for me. When I start it the progress bar started also and a window of my compression program opens. The tool works and terminates the operation normally. But the "TrimmedImage" folder is empty. I don't know what is wrong. Any help would be appreciated.

                Charly


                2011-07-24_172556.jpg

                He who makes no mistakes, makes nothing

                1 Reply Last reply Reply Quote 0
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  Charly

                  You must have Java enabled and the control-panel preferences set to allow 'jar' files to execute locally - these are needed to execute the code needed to manipulate the image data outside of Ruby...
                  A 'jar' file is a compiled Java-applet - in this case the various SKM/Image jar files are devised to do individual simple tasks not possible with basic Ruby...
                  You currently have 'jar' files set to open with you compression program!
                  These 'jar' files need to be left as executable-files set to open/run with Java...
                  Edit your compression program options to exclude 'jar' as one of the file types to open with that app' and ensure they run with Java itself... This is my Alzip settings NOT to open 'jar' files when I double-click on them...Capture.PNG

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • charly2008C Offline
                    charly2008
                    last edited by

                    Hi TIG,

                    I had not thought about this simple solution. Now it works as it should. A great tool and a great developer. Thank you very much TIG.

                    Charly

                    He who makes no mistakes, makes nothing

                    1 Reply Last reply Reply Quote 0
                    • charly2008C Offline
                      charly2008
                      last edited by

                      Hi,

                      I've used the plugin again with two PNGs. With the EURO PNG it works flawlessly. The second generated PNG with the lady does not work. So I suspect that the Second PNG is flawed. Does anyone know what could be the error in this PNG?

                      Charly


                      2011-09-30_001831.jpg


                      2011-09-30_001424.jpg


                      PNG Files.zip

                      He who makes no mistakes, makes nothing

                      1 Reply Last reply Reply Quote 0
                      • TIGT Offline
                        TIG Moderator
                        last edited by

                        First off the time taken to process is related to the number of pixels and although you can't see them there are hundreds around the woman. You could crop it to just her and some background...

                        If there is even the slightest transparency associated with the woman's pixels they are taken as transparent too, so they could all be ignored when finding edges and therefore there are then no edges to process - hence the error message...
                        I'll have a look at the woman.PNG and check it out...

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • TIGT Offline
                          TIG Moderator
                          last edited by

                          Here goes... I did the following...
                          Edited the PNG with Gimp.
                          Auto-cropped it to minimize the background area.
                          Flattened it to remove all transparency.
                          Layer > Added Alpha-channel, to allow transparency again.
                          Selected the now white background with the magic-wand and deleted it.
                          Saved it.
                          Used as an Image in a SKP approximating it to the height of a woman.
                          It ImageTrimmed quite quickly and produced this result...WomanImageTrimmed.PNGWomanImageTrimmed.skpHere's the edited PNG tooP4280004.png

                          TIG

                          1 Reply Last reply Reply Quote 0
                          • Rich O BrienR Offline
                            Rich O Brien Moderator
                            last edited by

                            Have you any tips for trees?

                            Download the free D'oh Book for SketchUp 📖

                            1 Reply Last reply Reply Quote 0
                            • charly2008C Offline
                              charly2008
                              last edited by

                              Hi TIG,

                              thank you for the explanation and effort. I took the photo in Photoshop and cropped again and it worked so well. Thanks again.

                              Charly

                              He who makes no mistakes, makes nothing

                              1 Reply Last reply Reply Quote 0
                              • charly2008C Offline
                                charly2008
                                last edited by

                                Hi Rich,

                                For trees, it basically works just like it "TIG" has described above. Unfortunately, within the image transparent areas may not be present as I noted in a experiment. The edges must first be processed cleanly. The picture shows a try with GIMP.

                                Charly


                                2011-09-30_170226.jpg


                                Untitled.skp

                                He who makes no mistakes, makes nothing

                                1 Reply Last reply Reply Quote 0
                                • Rich O BrienR Offline
                                  Rich O Brien Moderator
                                  last edited by

                                  On LoRes .png I don't have an issue but with HiRes it goes for a long think and sometimes crashes SU.

                                  I was wondering if there was a particular set of guidelines that allow for optimum output with relatively low processing times.

                                  Nice tree Charly 👍

                                  Download the free D'oh Book for SketchUp 📖

                                  1 Reply Last reply Reply Quote 0
                                  • TIGT Offline
                                    TIG Moderator
                                    last edited by

                                    Don't do it you fool!
                                    "Just step away from the tree... put your mouse down where I can see it..."

                                    But seriously though folks 😕

                                    Spend time up front getting the PNG right.
                                    Crop it tightly so there's minimal transparent background.
                                    Make sure that the outline isn't too complex, e.g. any thin leaves, twigs, branches etc, that are less than ~2pxs wide will be ignored because the edges they define will be considered 'coincident' and therefore won't make a face, BUT they'll still clog up the processing time if they are included in the pixels to look at - so either erase them so they are not considered OR fatten them up so they are used.
                                    The edges of every 'hole' in the PNG have to be individually processed, 'smoothed' etc - so the more holes the longer it'll take to complete.
                                    Be patient - if it whites-out it's almost certainly still working away on things, but it's just taking its time - so have a coffee [or a glass of beer!] or two and chill out...
                                    This palm took too many hours to process in the background while I did something else [>7!]...Palm14x.pngIt has a lot of thin 'fronds' to process... 😒

                                    TIG

                                    1 Reply Last reply Reply Quote 0
                                    • L Offline
                                      leminilab
                                      last edited by

                                      Alright, I might be a little ambitious there but I have this logo which is a perfect example of things I usually would want to outline.
                                      Usually I open these vector logos in Illustrator, export it to dwg, import in SU and make faces et voilà.

                                      But with this one, I get a bad export from Illustrator which I don't know how to clean:
                                      messy dwg export from Illustrator.jpg

                                      So I turned to ImageTrimmer and blessed TIG and all the ruby programmers one more time ( ☀ ).

                                      But, believe it or not, when I open this png logo as an image in SU, save the file and launch ImageTrimmer, the statusbar appears and at the same time it opens my Nokia Ovi Store app ( 😮 ), then stops and nothing happens...

                                      What do you think f that (especially the Nokia part 😮 😮 😮 )?


                                      logo-nb.png

                                      • "Live every day as if it were your last and then some day you'll be right."
                                      • "ThomThom rules!!!"
                                      1 Reply Last reply Reply Quote 0
                                      • Rich O BrienR Offline
                                        Rich O Brien Moderator
                                        last edited by

                                        😲

                                        Is this Nokia thing a Java launcher? I know this plugin is heavily reliant on Java so it could be related to that?

                                        Anyway I'd add any Ruby Console messages here if there are any showing. The thing I've noticed with ImageTrimmer is that it's doing something even when it appears nothing is happening.

                                        Download the free D'oh Book for SketchUp 📖

                                        1 Reply Last reply Reply Quote 0
                                        • L Offline
                                          leminilab
                                          last edited by

                                          Rich,

                                          It is an app I'd installed to backup my phone's contacts onmy computer... It's called NOkia Ovi Suite. Made me laugh a while 😄

                                          Here's the Console message from my other computer (which doesn't have the Nokia suite installed... You never know... 😄 😞
                                          Error: #<Errno::ENOENT: No such file or directory - C:\Users\le miniLab\Desktop\TrimmedImages\logo-nb[Edges].dat>
                                          C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/SKMtools/ImageTrimmer.rb:238:in readlines' C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/SKMtools/ImageTrimmer.rb:238:in make_edges'
                                          C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/SKMtools/ImageTrimmer.rb:187:in process_image' C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/SKMtools/ImageTrimmer.rb:164:in initialize'
                                          C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/SKMtools/ImageTrimmer.rb:769:in new' C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/SKMtools/ImageTrimmer.rb:769 C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/SKMtools/ImageTrimmer.rb:238:in call'
                                          C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/SKMtools/ImageTrimmer.rb:238

                                          I think this time Image Trimmer didn't do anything while it looked like it didn't do anything! 😄

                                          • "Live every day as if it were your last and then some day you'll be right."
                                          • "ThomThom rules!!!"
                                          1 Reply Last reply Reply Quote 0
                                          • TIGT Offline
                                            TIG Moderator
                                            last edited by

                                            Nicolas

                                            Seems you might not have Java enabled correctly...
                                            Look back through this thread about how it needs to be installed / control-panel etc... and that any .jar files must be executables, and NOT opened by other apps, like zip apps etc...

                                            If Java is properly set up the .jar files will fire and thereby make the files needed for ImageTrimmer to work...

                                            TIG

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 6
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 18
                                            • 19
                                            • 8 / 19
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement