[Plugin] PNGwhite2transparent v1.2 20110213

[Plugin] PNGwhite2transparent v1.2 20110213

Postby TIG » Fri Jan 21, 2011 2:00 pm

The SKMtools now contains a new script and its jar file...
Download the set from here http://forums.sketchucation.com/viewtop ... 77#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.

0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] PNGwhite2transparent

Postby TIG » Fri Jan 21, 2011 7:15 pm

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.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] PNGwhite2transparent

Postby Chris Fullmer » Fri Jan 21, 2011 8:19 pm

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?
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] PNGwhite2transparent

Postby TIG » Fri Jan 21, 2011 9:36 pm

Chris Fullmer wrote: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... :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] PNGwhite2transparent

Postby Bob James » Tue Jan 25, 2011 2:03 am

Thank you, TIG. A really useful addition. :thumb:
0
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
User avatar
Bob James 
Premium Member
Premium Member
 

Re: [Plugin] PNGwhite2transparent

Postby rusalkas » Sat Jan 29, 2011 10:55 pm

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
0

rusalkas 
 

Re: [Plugin] PNGwhite2transparent

Postby TIG » Sun Jan 30, 2011 1:19 am

Rusalkas

I think you have misconstrued what this tool does - I have PM'd you about it - suggesting ImageTrimmer is more what you need ??? :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] PNGwhite2transparent v1.2 20110213

Postby TIG » Sun Feb 13, 2011 3:52 pm

Here's v1.2 viewtopic.php?p=302827#p302827 - follow the links to the 'download' page in SKMtools......
The MAC jar file execution has at last been addressed :sketchstatic:
[My thanks to Dave R for helping with testing etc :D ]
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...
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: thinga, zul6041 and 23 guests

Visit our sponsors: