[Plugin] PNGwhite2transparent v1.2 20110213
-
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
Version:
1.0 20110121 First issue.
1.1 20110121 Transparent color now 'white'.
1.2 20110213 MAC jar execution addressed.
-
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. -
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?
-
@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 useUI.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...
-
Thank you, TIG. A really useful addition.
-
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.jpgBest withes
rusalkas -
Rusalkas
I think you have misconstrued what this tool does - I have PM'd you about it - suggesting ImageTrimmer is more what you need ???
-
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...
Advertisement