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

    Image Trimmer Plugin issue

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    40 Posts 7 Posters 8.7k Views 7 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.
    • TIGT Offline
      TIG Moderator
      last edited by

      @Bob
      It's almost certain that your PNG is not set up properly.
      ImageTrimmer needs the PNG image to contain 2 types of pixel - transparent and opaque.
      If you have some semi-transparent pixels they are still seen as being transparent !

      So use something like Gimp to edit the PNG...

      Flatten it, so that then no pixels are transparent at all.
      Now add an Alpha channel [transparency].
      Now use the magic-wand to select the colored pixels [probably == 'white'] which you want to be transparent.
      Check that the pixels that you'd expect to be 'transparent' are selected properly.
      [If needed you can select another 'colored' area - e.g. == 'off-white']
      Then Delete them.
      Save the PNG with the changes.
      Reimport the corrected Image and try ImageTrimmer gain...

      Alternatively, attach the problem PNG and I'll fix it... BUT it's best if you understand how to sort our your own mess........

      TIG

      1 Reply Last reply Reply Quote 0
      • D Offline
        Dprince
        last edited by

        i keep getting this error with immage trimmer https://www.screencast.com/t/hePdoETQ

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

          @dprince said:

          i keep getting this error with immage trimmer https://www.screencast.com/t/hePdoETQ
          Please read the post, just before yours: https://sketchucation.com/forums/viewtopic.php?p=646097#p646097
          I suspect that your PNG's transparency is not set up correctly...

          TIG

          1 Reply Last reply Reply Quote 0
          • D Offline
            Dprince
            last edited by

            I got the same error message after doing what you suggested

            1 Reply Last reply Reply Quote 0
            • Dave RD Offline
              Dave R
              last edited by

              Share the image so we can help you out.

              Etaoin Shrdlu

              %

              (THERE'S NO PLACE LIKE)

              G28 X0.0 Y0.0 Z0.0

              M30

              %

              1 Reply Last reply Reply Quote 0
              • D Offline
                Dprince
                last edited by

                Thanks. here's the image


                bottle.png

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

                  First off, do yourself a favor and crop the PNG to remove all of the unwanted 'white' surrounds.
                  Otherwise the processing time extends unnecessarily.

                  Next flatten the PNG and reset an Alpha layer.
                  Now pick all of the unwanted white parts around the edges, and delete them...

                  Import the PNG Image.
                  Run ImageTrimmer...

                  Near the end, when you are prompted, do NOT choose to 'smooth' the cut-out image's outline - something about this particular shape causes its faces to fail - without any obvious errors... 😲
                  If this happens unexpectedly, you can just hit Undo, and the un-smoothed cut-out is reverted and kept anyway...

                  But now by skipping the 'smooth' step you will get a trimmed image...Capture.PNG

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • Dave RD Offline
                    Dave R
                    last edited by

                    Interesting.

                    Thank you.

                    Etaoin Shrdlu

                    %

                    (THERE'S NO PLACE LIKE)

                    G28 X0.0 Y0.0 Z0.0

                    M30

                    %

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      Dprince
                      last edited by

                      im not sure how to do that

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

                        @dprince said:

                        im not sure how to do that
                        Do what ?
                        Your overly cryptic comment is not helpful !
                        If you mean the skipping the 'smoothing' step, just cancel it or do it and immediately Undo it to get the unsmoothed form back.

                        If you mean adjusting the PNG file...
                        You need an image-editing tool, like Gimp or Photoshop.
                        Open the PNG usig that editor.
                        Auto-Crop the image to remove all of the unwanted 'white' surrounds.
                        Otherwise the processing time extends unnecessarily as that'll be ignored eventually but still needs analyzing..
                        Next flatten the PNG to remove all transparent pixels.
                        Next add an Alpha Layer [for the transparent parts].
                        Pick all of the unwanted white parts around the edges [using the magic-wand], and delete them...
                        You should now see through the parts that will be removed by ImageTrimmer.

                        Import the PNG Image into SketchUp.
                        Run ImageTrimmer...
                        The 'background' parts are removed, and the face is 'cut-out'...
                        Follow the tip about skipping/undoing the final 'smoothing' step - because with some images it can fail [inexplicably] and can delete the whole face....

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          Dprince
                          last edited by

                          is it possible for me to send you the image and you do it for me. I did what you mention and im still getting the same issue.

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

                            At which step does it fail ?

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              Dprince
                              last edited by

                              After I flatten the image.

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

                                What do you mean by 'flatten' ?

                                The 'smooth' step I referred to is actually called 'simplify' in the closing dialog [it attempts to 'smooth' the outline], and it is optional - so just cancel it...
                                Because of something unfathomable in your image the 'simplifying' fails, so do not do it...
                                I'll try and see if I can get to the bottom of this issue, but as I'm not getting any error messages of use, then I have a lot to get through...

                                TIG

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

                                  I think I've found the cause for the 'simplify' failure.
                                  It's how the newer version of SketchUp handles exploded entities !
                                  I can fix that...
                                  I'll publish an update in the ImageTrimmer main thread asap.

                                  But it might not fix your issue, because your Gimp-processed PNG might not be correct...
                                  Can you attach a PNG that you think you've fixed a that we can check it...
                                  The 'Flatten' issue might be relevant then ??

                                  TIG

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

                                    Here's the fixed version which addresses the 'Simplify' step issue: https://sketchucation.com/pluginstore?pln=SKMtools

                                    Is the 'Flatten' issue still relevant ?
                                    If so attach your adjusted PNG...

                                    TIG

                                    1 Reply Last reply Reply Quote 0
                                    • D Offline
                                      Dprince
                                      last edited by

                                      The new version worked. THANKS!!

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

                                        Hooray !

                                        TIG

                                        1 Reply Last reply Reply Quote 0
                                        • maxhouserocksM Offline
                                          maxhouserocks
                                          last edited by

                                          TIG, Thank you so much for your detailed response and the updated script.
                                          I was also able to get it to work by NOT doing the smoothing option. I used "Simplify Selected Curves" in "Edge Tools2" to smooth the alpha selection once converted to lines. Worked great!
                                          I will try the new updated one shortly also. It is an AMAZING time saver for us creating products from images for retail store stocking.

                                          I hope people thank you enough on a daily basis, because there are a handful of you guys that really make sketchup an amazingly powerful tool when applying the scripts you create. I try to avoid tedious, repetitive tasks as much as possible and usually, someone like your self has run into the same problem and solved it. A mighty "Huzzah" to you sir!

                                          Thanks again for the help,
                                          Bob

                                          Robert A. Christman
                                          http://rachristman.blogspot.com/

                                          1 Reply Last reply Reply Quote 0
                                          • K Offline
                                            kucher
                                            last edited by

                                            Hi,

                                            I have trouble with trimming speed, it took 20 minutes to trim the FRONT view attached. The TOP view didn't respond still after half an hour of processing. Maybe there is a way to optimize the files or something? Thanks.


                                            TOP view


                                            FRONT view

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement