• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[Plugin] ImageTrimmer

Scheduled Pinned Locked Moved Plugins
364 Posts 58 Posters 228.1k Views
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.
  • C Offline
    charly2008
    last edited by 29 Sept 2011, 22:41

    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
    • T Offline
      TIG Moderator
      last edited by 30 Sept 2011, 08:30

      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
      • T Offline
        TIG Moderator
        last edited by 30 Sept 2011, 08:46

        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
        • R Offline
          Rich O Brien Moderator
          last edited by 30 Sept 2011, 09:03

          Have you any tips for trees?

          Download the free D'oh Book for SketchUp 📖

          1 Reply Last reply Reply Quote 0
          • C Offline
            charly2008
            last edited by 30 Sept 2011, 13:34

            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
            • C Offline
              charly2008
              last edited by 30 Sept 2011, 15:14

              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
              • R Offline
                Rich O Brien Moderator
                last edited by 30 Sept 2011, 15:25

                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
                • T Offline
                  TIG Moderator
                  last edited by 30 Sept 2011, 15:27

                  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 18 Nov 2011, 21:48

                    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
                    • R Offline
                      Rich O Brien Moderator
                      last edited by 18 Nov 2011, 21:55

                      😲

                      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 18 Nov 2011, 22:02

                        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
                        • T Offline
                          TIG Moderator
                          last edited by 18 Nov 2011, 22:32

                          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
                          • L Offline
                            leminilab
                            last edited by 18 Nov 2011, 22:44

                            Thank you very much TIG, I'll check that tomorrow! 🎉

                            • "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
                            • L Offline
                              leminilab
                              last edited by 27 Nov 2011, 10:22

                              Hi!

                              It works. I had to create an admin account with a password ot get it to work but it worked perfectly.
                              I also understood what created these unwanted lines on dwg export from Illustrator: There was a clipping mask with a gradient applied to the shape... I ungrouped the shape and the gradient, re-exported and it came out perfect and could use my usual workflow.

                              Anyway: thank you very much for your time and thanks a lot for this very valuable tool! 👍

                              • "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
                              • unclebimU Offline
                                unclebim
                                last edited by 29 Nov 2011, 15:12

                                Hi,

                                I have been using this plugin and I am very happy with it. But lately I am having problems with some, not all, images, that when processed appear like that. Just very few pixels are included in the component made by the plugin. What could be the reason?


                                capture_11292011_165912_cr.jpg

                                1 Reply Last reply Reply Quote 0
                                • J Offline
                                  JMdesigns
                                  last edited by 29 Nov 2011, 15:42

                                  @unclebim said:

                                  Hi,

                                  I have been using this plugin and I am very happy with it. But lately I am having problems with some, not all, images, that when processed appear like that. Just very few pixels are included in the component made by the plugin. What could be the reason?

                                  HI,
                                  how did you change your Java settings? I have windows 7 pro 64, and cant seem to get this plugin to work?

                                  1 Reply Last reply Reply Quote 0
                                  • unclebimU Offline
                                    unclebim
                                    last edited by 29 Nov 2011, 15:46

                                    @jmdesigns said:

                                    @unclebim said:

                                    Hi,

                                    I have been using this plugin and I am very happy with it. But lately I am having problems with some, not all, images, that when processed appear like that. Just very few pixels are included in the component made by the plugin. What could be the reason?

                                    HI,
                                    how did you change your Java settings? I have windows 7 pro 64, and cant seem to get this plugin to work?

                                    I did not change Java settings, I run SU as administrator and it works. The only problem I have lately is as quoted.

                                    1 Reply Last reply Reply Quote 0
                                    • J Offline
                                      JMdesigns
                                      last edited by 29 Nov 2011, 16:17

                                      😍 Thanks unclebim, that worked perfect !...the plugin works 😍 😍

                                      1 Reply Last reply Reply Quote 0
                                      • T Offline
                                        TIG Moderator
                                        last edited by 29 Nov 2011, 16:23

                                        unclebim

                                        Looks to me like your PNG has lots of semi-transparent areas.
                                        The way the tool works is the find all transparent pixels and then use them to determine the 'outlines' of the image that will remain.
                                        If a pixel is even slightly transparent it's taken as one to be considered when forming the 'outlines'!
                                        So typically when editing the image out-side of Sketchup 'pre-trimming' you need to ensure that firstly there are NO transparent pixels - i.e. you need to 'Merge' any layers and 'Flatten' it.
                                        Then add back a transparent alpha layer.
                                        then select all of the outer 'white' areas [sometimes the pixels are 'black'!] perhaps using a magic-wand tool [depends on you ImageEditor] and delete them.
                                        So now you should have a solid image with just the 'background' showing as transparent.
                                        Save the PNG and [re]import into your SKp as an Image and try ImageTrimmer on it again...
                                        This time what you want to be left behind should be...

                                        TIG

                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          dannielstevanus
                                          last edited by 19 Apr 2012, 19:18

                                          dear TIG :

                                          I've try image trimmer plugin, but after the process it nothing happened to my png image.. can you explain whats wrong with that??

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

                                          Advertisement