[Plugin] ImageTrimmer

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby Gaieus » Sun Apr 22, 2012 2:04 pm

Danniel,

Complex geometry is just complex geometry no matter how you create it; as a 3D tre or as a 2D, face me component with extremely detailed cutouts for realistic shadows. Both will be handled with issues in SketchUp.

For such plants, a much more rough, simple manual outline is fine most of the time. Or use some technique Alan Fraser describes here:
viewtopic.php?p=48726#p48726
0
User avatar
Gaieus 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby TIG » Sun Apr 22, 2012 3:04 pm

After it's trimmed you need to simplify the outline [built-in] BUT you need to offer it a sensible image with reasonably sized areas/holes and distinct transparent/opaque areas - I'll look at the image and reply shortly...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby TIG » Sun Apr 22, 2012 5:44 pm

Your tree png will fail to give a good/quick result because many of its pixels have slight transparency.
The Trimmer removes all transparent pixels, even semi-opaque ones.
So Edit the png [with say Gimp].
Flatten it so there is no transparency.
Add back a transparent alpha-channel layer.
Magic-wand select and then delete all of the 'white' background pixels.
There are many <=2x2 pixel 'holes' and leaves which will be ignored anyway [after being 'inspected'], so a little image-editing to avoid these would be advisable too - re-scale/size, or manual edit pixels, or both...
Also crop it to remove unneeded transparent background pixels, which contribute to processing time unnecessarily as they will be ignored, but still need considering...
Images with more than ~1,000,000 pixels can take ages [depending on their complexity]. I made a ~20,000px version...
It then takes about 15 minutes to trim it into this very complex form...
If Sketchup becomes unresponsive it doesn't mean it's crashed/hung; it's just busy process - the Task Manager will show it is still hard at work...
If you were to trim around a face using the image as a texture/guide it will take some time.
ImageTrimmer does it for you - it's probably not too much quicker, but you can do something less tiresome as it works in the background...
You can't simplify the 'quality' of the trimming until after all pixels are considered because how else might we know what we have to do ?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby pololo » Mon May 14, 2012 10:39 am

Thank you very much Tig!!! Excellent plugin!!! :berserk: :berserk:
After several attempts.... It works perfectly under Windows 7 64 bits :sketchstatic: :thumb:
0

pololo 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby charly2008 » Wed May 23, 2012 11:49 pm

Hi,

It's a really good tool.
0
He who makes no mistakes, makes nothing
User avatar
charly2008 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby charly2008 » Sun Jul 29, 2012 1:45 pm

Hi,

So far I had no problems with this tool. Now I wanted to trim the Romans PNG and get the result shown below. I have no idea why.

Charly
0
He who makes no mistakes, makes nothing
User avatar
charly2008 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby TIG » Sun Jul 29, 2012 2:59 pm

The issue is that the PNG image has transparency associated with most of its pixels.
'ImageTrimmer' only keeps 100% opaque pixels.
If you edit the PNG [with say Gimp].
Flatten it [the background goes white].
Add a Layer with transparency [alpha-channel].
Use the magic-wand to select the background [here it's two clicks to include the 'hole' between the men].
Then auto-crop the image to minimize the background size - every pixel has to be inspected so the fewer there are the quicker the trimming.
It then ImageTrims OK...
vexill2bCapture.PNG
vexill2b.skp
vexill2b.png
Incidentally - I recently undated my compression software... and when I just tried to use ImageTrimmer it failed [hung] - this was because for it to work .jar files must open with their default application [Java] BUT by default my compression software has .jar set as one of its file associations and so it opens the file rather than Java executing it... It was easily fixed by resetting the compression tool's preferences NOT to include .jar as one of its file formats... So remember... ensure .jar files execute with Java and don't open with your compression software. Even I get tripped upnow and again... :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby charly2008 » Sun Jul 29, 2012 7:08 pm

Hi TIG,

thanks for your detailed explanation. I learned something again.

Charly
0
He who makes no mistakes, makes nothing
User avatar
charly2008 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby picky1958 » Fri Feb 08, 2013 9:48 pm

Sorry! I am NOT getting it! I tryed everything, but I can't get it to work. I don't know much about Java. I see those two files from/to get created as well as a copy of the image in the TrimmedImages folder, but nothing else happens. I tryed to run SU as admin, at least from/to got created... but i did't get any futher. Any "simple" (for dummies) suggestions? Thanks
0
User avatar
picky1958 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby TIG » Fri Feb 08, 2013 11:59 pm

Please fill in your user-profile so that we know your versions, OS etc...
Help us to help you.

This tool uses some Java functionality that is not built into the Ruby version shipped with Sketchup.
It uses some '.jar' files which are small 'executables' that do a single specific job - in tis case in manipulating images and their data etc.
It works on PC and MAC, but you must have Java 'enabled'.
I think more recent MACs have this as 'optional', but most PCs have it set up by default.
Another issue is that these '.jar' files are small 'executables' - like an '.exe' file - and some [de]compression software hijack this file-type extension [along with many others, without asking, as it is installed] and it will try to 'open' the .jar itself so that you can see its contents.
If so, then you must remove '.jar' from that app's list of 'associated file-types'.
A '.jar' file must always be set to 'execute' - i.e. open with Java...

Also the tool writes temporary 'ini' files to a subfolder in the Plugins folder so you must ensure that you personally have FULL read/write security permissions to the Plugins folder and all of its subfolders and files...

Many hundreds of users get this tool to work 'out-of-the-box'... so you need to check your system settings and retry... We know it is making copies of the image etc, but the timing of the stall suggests that the next step with the .jar file is the thing that is failing...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby picky1958 » Sat Feb 09, 2013 6:39 am

Hi TIG! I know some people are getting the tool working "out-of the-box"... and this drives me crazy! ;-) I mean, until now I never had any problem with anything installed on my PC, but this time I really can't find out what I am doing wrong. So... my PC runs Windows 7 Home Premium SP1 64 Bit. I got Java set to open .jar files. I am not sure about the read/write stuff. I tryed to change the settings of the folder but once I wanted to save them, it didn't do it. So I retried again and again, but every time it didn't save the changes. That's where I started SU as admin and it did create at least the from/to.ini files, which it didn't before. After that nothing else happened. No warning, no message, nothing.
Thanks for your help! Cheers from Germany.
Ralf
0
User avatar
picky1958 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby TIG » Sat Feb 09, 2013 10:59 am

It looks like a permissions issue: especially since you get different results as yourself and as an Admin.
Being an Admin is not sufficient to allow you to have full access to things within a folder if its permissions are inherently limited.
Log in as an Admin.
You'll have to translate the following 'titles' into German if your locale is not 'EN'...
Highlight the Plugins folder's icon and use the right-click context-menu > Properties > Security > Edit set permissions to that folder to FULL for everyone, including yourself!
Apply and OK to save.
Check that the permissions have filtered down and that FULL also applies to the Plugins folder's contents - both files and subfolders, and their contents etc.
Retry using the tool.

Tip: you might from time to time want to add files/subfolders into other Sketchup folders... I recommend you also fix the permissions of the Components, Materials and Styles folders...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby picky1958 » Sun Feb 10, 2013 9:35 am

Ok, now I really tryed every single combination and I'm still not able to make it work. I guess I am giving up on this one :-( Is there any other tool I can use just to trace around the transparent part of a png without having to do it manually? Probably not, ha? Thanks for your help.
Ralf
0
User avatar
picky1958 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby leminilab » Sun Feb 10, 2013 10:26 am

Adding a Windows Admin account with a password (don't know if it has something to do with it...) did the trick for me.
0
- "Live every day as if it were your last and then some day you'll be right."
- "ThomThom rules!!!"

leminilab 
Premium Member
Premium Member
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby picky1958 » Sun Feb 10, 2013 10:29 am

Hi leminilab, that's worth a try! Did you run SU from that account then?
0
User avatar
picky1958 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby leminilab » Sun Feb 10, 2013 11:00 am

picky1958 wrote:Hi leminilab, that's worth a try! Did you run SU from that account then?

Yes. I think I re-installed SU and Image Trimmer on this account and it worked.

Sorry for not being more positive about this but I had to format my pc and I haven't needed image trimmer since...
0
- "Live every day as if it were your last and then some day you'll be right."
- "ThomThom rules!!!"

leminilab 
Premium Member
Premium Member
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby picky1958 » Sun Feb 10, 2013 11:29 am

leminilab wrote:
picky1958 wrote:Hi leminilab, that's worth a try! Did you run SU from that account then?

Yes. I think I re-installed SU and Image Trimmer on this account and it worked.

Sorry for not being more positive about this but I had to format my pc and I haven't needed image trimmer since...


I tryed it... not working either. :-( Thanks anyways. Ralf
0
User avatar
picky1958 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby leminilab » Sun Feb 10, 2013 1:49 pm

Have you got Java installed?
0
- "Live every day as if it were your last and then some day you'll be right."
- "ThomThom rules!!!"

leminilab 
Premium Member
Premium Member
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby picky1958 » Sun Feb 10, 2013 1:58 pm

leminilab wrote:Have you got Java installed?


Yes, I do.
0
User avatar
picky1958 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby leminilab » Sun Feb 10, 2013 2:24 pm

Well Admin acount and Java were the two culprits for me. I'm out of ides... Sorry...
0
- "Live every day as if it were your last and then some day you'll be right."
- "ThomThom rules!!!"

leminilab 
Premium Member
Premium Member
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby eLaCiD » Thu Mar 28, 2013 9:25 am

Sorry on this old question but I try to find solution w/o success.
I read all of posts here but on the end need help.
ImageTrimmer don't work


Let's go :)

Windows XP pro
IE 8
SU 8

Folder is C:/Temp
Image is Test.png

Plugin folder
PluginsFolder.png


SKMtools folder
SKMtoolsFolder.png


When I start ImageTrimmer from SU (Tools-ImageTrimer) status line show it works.
After a while process is finished but nothing heppened.
In folder C:/Temp/TrimmedImages (after this there is only Test.png w/o other two files.
Path in files "from.ini" and "to.ini" is ok.

RC shows
RC1.png


If I try manualy with click on EdgeDetector.jar then in folder C:/Temp/TrimmedImages appears and other files - Test[Edges].dat and Test[Edges].png

I try from RC with this result
RC2.png



What now?
0
User avatar
eLaCiD 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby TIG » Thu Mar 28, 2013 10:03 am

The error tells you is is not making the .dat file.
This is made on the .jar side so it suggests one of several things...
Do you have FULL security permissions to the Plugins folder and its subfolders and their contents?
Select icon right-click context menu > Properties > Security > Edit > FULL... [perhaps as an Admin?]
Because it reads/writes files from the SKMtools subfolder this must be fully accessible to 'ALL'...

Another possibility...
Do you have Java installed on your PC ?
If not install it, it's freely available on the http://www...

Next are JAR files set to 'open' [execute] with Java ?
A JAR file is a small executable that is run by Java to do a simple task - here it processes image data, not readily available cross-platform with SketchUp's version of Ruby alone...
A default Java installation should be set to execute JARs, BUT if you have installed certain deCompression [ZIP] applications they may have a list of file-associations which 'hijack' various file-types and then open them directly within that app, rather than their native application as required for JARs. JAR is often one of those file-types... to correct it open the deCompression [ZIP] app and then open its settings/options dialog - look for a file-associations tab... uncheck JAR, Save the changes and close...

...and retry ImageTrimmer...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby eLaCiD » Thu Mar 28, 2013 10:29 am

Unfortunately there is not option Security :(

Java is already instaled
Java.png


WinRar setings is
WinRaR.png
0
User avatar
eLaCiD 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby TIG » Thu Mar 28, 2013 11:45 am

These Java Control Panel settings work for me - see the screen-shots attached...
Windows XP permissions work slightly differently from more recent Windows versions... BUT you can still make sure that you have unrestricted access-rights to the Plugins folder and its contents...
http://www.microsoft.com/resources/docu ... x?mfr=true
http://www.microsoft.com/resources/docu ... x?mfr=true
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby eLaCiD » Thu Mar 28, 2013 1:13 pm

My Java Control Panel settings are same as yours.

This made help abut how to put security tab :)
http://www.microsoft.com/resources/docu ... x?mfr=true

Then with rigt_click

Plugins>Properties>Security
and in Plugins Folder
SKMgtools>Properties>Security

for all Group and user names all permission are marked - Allowe

Then I triggered ImageTrimmer.
Unfortunately :( situation ia same like before.
0
User avatar
eLaCiD 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby TIG » Thu Mar 28, 2013 1:47 pm

:?
Can you post the PNG you are trying to Trim...
At least if I can ImageTrim it we know it ought to work...
PM it if it's confidential...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby eLaCiD » Thu Mar 28, 2013 2:02 pm

TIG wrote::?
Can you post the PNG you are trying to Trim...
At least if I can ImageTrim it we know it ought to work...
PM it if it's confidential...



I think is not conected with images because I tried a few different PNG among other and this (downloaded from here)with no result.

HamsterWheel%2001.png
0
User avatar
eLaCiD 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby TIG » Thu Mar 28, 2013 2:13 pm

Works fine for me, so please post all of your Java settings and double-check that JAR files are set to open [execute] with Java...
The ZIP contains the input/skp/output...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby eLaCiD » Thu Mar 28, 2013 2:39 pm

Java settings :

JavaSettings.png
0
User avatar
eLaCiD 
 

Re: [Plugin] ImageTrimmer v2.2 20110213

Postby TIG » Thu Mar 28, 2013 4:20 pm

The only difference I have is the last item Java Quick Starter is unchecked in my version, BUT I'd not expect that to be an issue...

Can you run Sketchup as an Admin and see if it helps...
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

PreviousNext


 

Return to Plugins

Who is online

Users browsing this forum: No registered users and 15 guests

Visit our sponsors: