[Plugin] ImageTrimmer
-
Hi,
I have been using this plugin and I am very happy with it. But lately I am having problems with some, not all, images, that when processed appear like that. Just very few pixels are included in the component made by the plugin. What could be the reason?
-
@unclebim said:
Hi,
I have been using this plugin and I am very happy with it. But lately I am having problems with some, not all, images, that when processed appear like that. Just very few pixels are included in the component made by the plugin. What could be the reason?
HI,
how did you change your Java settings? I have windows 7 pro 64, and cant seem to get this plugin to work? -
@jmdesigns said:
@unclebim said:
Hi,
I have been using this plugin and I am very happy with it. But lately I am having problems with some, not all, images, that when processed appear like that. Just very few pixels are included in the component made by the plugin. What could be the reason?
HI,
how did you change your Java settings? I have windows 7 pro 64, and cant seem to get this plugin to work?I did not change Java settings, I run SU as administrator and it works. The only problem I have lately is as quoted.
-
Thanks unclebim, that worked perfect !...the plugin works
-
unclebim
Looks to me like your PNG has lots of semi-transparent areas.
The way the tool works is the find all transparent pixels and then use them to determine the 'outlines' of the image that will remain.
If a pixel is even slightly transparent it's taken as one to be considered when forming the 'outlines'!
So typically when editing the image out-side of Sketchup 'pre-trimming' you need to ensure that firstly there are NO transparent pixels - i.e. you need to 'Merge' any layers and 'Flatten' it.
Then add back a transparent alpha layer.
then select all of the outer 'white' areas [sometimes the pixels are 'black'!] perhaps using a magic-wand tool [depends on you ImageEditor] and delete them.
So now you should have a solid image with just the 'background' showing as transparent.
Save the PNG and [re]import into your SKp as an Image and try ImageTrimmer on it again...
This time what you want to be left behind should be... -
dear TIG :
I've try image trimmer plugin, but after the process it nothing happened to my png image.. can you explain whats wrong with that??
-
@dannielstevanus said:
dear TIG :
I've try image trimmer plugin, but after the process it nothing happened to my png image.. can you explain whats wrong with that??
If I saw the PNG image it might help
I suspect you haven't got any transparent pixels in it [as the 'background'] to be erased, so it doesn't change, except it becomes a component? ...
Are there any error messages or anything shown in the Ruby Console [open it before processing an image].
Post the PNG so we can at least start to see what the issue might be... -
It finally worked when i try to run sketchup as an administrator.. its a great plugins TIG, i want to appreciate your work for it.
it can work fine with people's image, but unfortunately when i try it to trees image it can't work properly and cause my sketchup stop working.. I think its because the complex transparent image in tree object so this plugins should process all of them one by one that cause this program run too heavy
I think this will be better if this plugins can process trees image, maybe it don't need too details, just enough trimming an outline of the tree. I hope I can choose an option whether I need a details trimming or just a basic trimming
I hope you can do some upgrade for this great plugins to become an excellent perfect image trimmer plugins in sketchup (just for suggestions).
i will upload my tree object that can't be processed with this plugins so you can try it TIG..
thanks for your great plugins
best regards- Danniel Stevanus -
-
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:
http://forums.sketchucation.com/viewtopic.php?p=48726#p48726 -
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...
-
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 ? -
Thank you very much Tig!!! Excellent plugin!!!
After several attempts.... It works perfectly under Windows 7 64 bits -
Hi,
It's a really good tool.
-
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
-
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...vexill2b.skpIncidentally - 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... -
Hi TIG,
thanks for your detailed explanation. I learned something again.
Charly
-
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
-
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...
-
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 -
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...
Advertisement