sketchucation logo sketchucation
    • Login
    ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

    [Plugin] PNGwhite2transparent v1.2 20110213

    Scheduled Pinned Locked Moved Plugins
    8 Posts 4 Posters 9.4k 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.
    • TIGT Offline
      TIG Moderator
      last edited by

      The SKMtools now contains a new script and its jar file...
      Download the set from here http://forums.sketchucation.com/viewtopic.php?p=293677#p293677


      TIG (c) 2011
      All Rights Reserved.
      THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
      WARRANTIES,INCLUDING,WITHOUT LIMITATION,THE IMPLIED WARRANTIES OF
      MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.


      pngwhite2transparent.rb


      Loaded by SKMtools.rb in the ../Plugins/ folder.
      Adds a new tool:
      pngwhite2transparent(folder_of_pngs)
      It needs PNGwhite2transparent.jar in the same folder.
      To use it type in the Ruby Console
      pngwhite2transparent 'C:/Temp/MyPNGsFolder'
      It makes a new folder
      C:/Temp/MyPNGsFolder/PNGwhite2transparent
      which will receive copies of all pf the PNG files in the folder.
      These PNG file copies are processed so 'pure white' pixels [255,255,255]
      are all made 'fully transparent'.
      If opens this new folder on completion.
      It also returns the path to this new folder [or 'nil'].
      For example: ensure your scenes have a pure white background, then export
      them as an animation as multiple individual PNG files, this tool then
      allows you to remove the backgrounds - then in any 'animation' you
      assemble [e.g. GIF] you have a 'see-through' background...


      Donations:
      By Paypal.com to info @ revitrev.org PayPalButton


      Version:
      1.0 20110121 First issue.
      1.1 20110121 Transparent color now 'white'.
      1.2 20110213 MAC jar execution addressed.


      TIG

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

        A minor update is available here.
        The jar file now makes the transparent color 'white' - although you never see it!
        However, if you subsequently flatten it then it reverts back to how it was before you processed it πŸ˜•
        Just dotting the i's.

        TIG

        1 Reply Last reply Reply Quote 0
        • Chris FullmerC Offline
          Chris Fullmer
          last edited by

          Very very cool TIG. What are you using to process the pngs? The jar file is a java file - does java have .png processing libraries then or something that you are utilizing?

          Lately you've been tan, suspicious for the winter.
          All my Plugins I've written

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

            @chris fullmer said:

            Very very cool TIG. What are you using to process the pngs? The jar file is a java file - does java have .png processing libraries then or something that you are utilizing?

            I taught myself Java a few weeks ago to utilize some of its functions.
            Initially some zip/unzip and making thumbnail pngs stuff for my SKMtools.
            I soon realized that you can do all sorts of things with .jar files - they are compiled .class file made from a .java file.
            I write then so typically they read a 'from.ini' and a 'to.ini' file to get the file paths etc that they need to use and then they do 'whatever you want'... You use UI.openURL(jar) and if you have changed the pwd to the one with the jar it reads the ini files and works...
            So far I can read/write images in different formats and sizes, zip/unzip files [including .skm that are actually zip files].
            There are already tools to get material/textures/SKMs' thumbnails, read/write different image file types, make/extract skm files [zip/unzip], make bumpmap png files from texture images, extract the frames from a gif as pngs, find a transparent png's 'edges' [ImageTrimmer] and now set selected pngs' white backgrounds as transparent...
            I have also go some unpublished stuff for .jar based 'Directory Browser' etc [you know how you can't [easily] use UI. openPanel() to get a directory] and 'File' operations that don't fail on unicode characters etc...
            When someone asked about transparent backgrounds in exported png files I saw the jar-way [you CAN set the background transparent with when you do a one png export... but not with batch animation png files]...

            I'm open to new ideas... πŸ˜•

            TIG

            1 Reply Last reply Reply Quote 0
            • Bob JamesB Offline
              Bob James
              last edited by

              Thank you, TIG. A really useful addition. πŸ‘

              i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

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

                Dear TIG
                I'm e new with Sketchup and i have typical problems which are similar as pngwhite2transparent. I was update the SKM tools loader and extracted it in my installation of program. I was done everything like in the post, but i don't know how it works. In the post:
                http://forums.sketchucation.com/viewtopic.php?t=34383 is instruction how to install his plugin:

                Loaded by SKMtools.rb in the ../Plugins/ folder.
                Adds a new tool:
                pngwhite2transparent(folder_of_pngs)
                It needs PNGwhite2transparent.jar in the same folder.
                To use it type in the Ruby Console
                pngwhite2transparent 'C:/Temp/MyPNGsFolder'
                It makes a new folder
                C:/Temp/MyPNGsFolder/PNGwhite2transparent
                which will receive copies of all pf the PNG files in the folder.
                These PNG file copies are processed so 'pure white' pixels [255,255,255]
                are all made 'fully transparent'.
                If opens this new folder on completion.
                It also returns the path to this new folder [or 'nil'].
                For example: ensure your scenes have a pure white background, then export
                them as an animation as multiple individual PNG files, this tool then
                allows you to remove the backgrounds - then in any 'animation' you
                assemble [e.g. GIF] you have a 'see-through' background...

                But in my program it doesn’t work, I thought that in sketchup it adds new plugin SKMTool, but not. So I will be very grateful if you can explain how to make my pictures.png without shadows and edges:
                http://www.imagic.pl/files//18736/./zdjecie2.jpg

                Best withes
                rusalkas

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

                  Rusalkas

                  I think you have misconstrued what this tool does - I have PM'd you about it - suggesting ImageTrimmer is more what you need ??? πŸ˜•

                  TIG

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

                    Here's v1.2 http://forums.sketchucation.com/viewtopic.php?p=302827#p302827 - follow the links to the 'download' page in SKMtools......
                    The MAC jar file execution has at last been addressed
                    [My thanks to Dave R for helping with testing etc πŸ˜„ ]
                    On a MAC you might find you are asked if you want to run a particular jar file - if so answer 'yes' - it's a one of prompt per jar-type so it should stop after the first run.

                    Feedback please...

                    TIG

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

                    Advertisement