[Plugin] ImageTrimmer

Re: [Plugin] ImageTrimmer 20101217

Postby Dave R » Tue Jan 04, 2011 7:47 pm

Post one of your tree PNGs.
0
Etaoin Shrdlu


%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] ImageTrimmer 20101217

Postby Humpmetwice » Tue Jan 04, 2011 10:27 pm

Thought I had it fixed, I finally got all the plugins out of the folder called compatibility files and in the right place. Used the .png file you made for Dave R I think and everything started out good with no errors. Then Sketchup stopped responding and had to cancel it but it still made three files in a folder on my desktop called ImageTrimmer. One was the original .png I think, one was what looked like the outline of the image in .png for mat and the other was a .dat file.
0
User avatar
Humpmetwice 
 

Re: [Plugin] ImageTrimmer 20101217

Postby TIG » Tue Jan 04, 2011 10:32 pm

humpmetwice wrote:Thought I had it fixed, I finally got all the plugins out of the folder called compatibility files and in the right place. Used the .png file you made for Dave R I think and everything started out good with no errors. Then Sketchup stopped responding and had to cancel it but it still made three files in a folder on my desktop called ImageTrimmer. One was the original .png I think, one was what looked like the outline of the image in .png for mat and the other was a .dat file.

Good at least it's making the files...
It should then be processing the 'dat' file into the trimmed form...
Were there any error messages in the Ruby Console or elsewhere ?
How long did you wait - SUP WILL always stop responding with any tool than is intensive... BUT often complete given a chnace ???
How big [pixels] was the Image?
Can you zip/post or PM the three files... For an independent test.......
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer 20101217

Postby Humpmetwice » Wed Jan 05, 2011 12:54 am

Its taking well over 30 minutes so I just close Sketchup all together so I don't get to see if any errors are in the Ruby Console. I,m using the image you set up for David R just to be sure it would work but here are the files.
0
User avatar
Humpmetwice 
 

Re: [Plugin] ImageTrimmer 20101217

Postby TIG » Wed Jan 05, 2011 1:00 am

It should take only 'minutes' if that...
I'll look at the files and come back to you...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer 20101217

Postby TIG » Wed Jan 05, 2011 1:09 am

Then original png works fine for me within 20 seconds it's done...
The edges png and dat files are identical from you and me...
SO something is stopping your version completing...
DO you have appropriate access rights to the TrimmedImages folder ?
I will soon post a slight update that might help...
Here's the files back with mine added
TrimmedImages.zip
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer 20110105

Postby TIG » Wed Jan 05, 2011 1:23 am

Here's an update viewtopic.php?p=293677#p293677
The time-out for larger .dat files enhanced [again]...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer 20110105

Postby TIG » Wed Jan 05, 2011 3:00 pm

Here's yet another update viewtopic.php?p=293677#p293677
I recommend you install it asap...

The speed to process the trimmed faces is now greatly improved and the 'risk of it hanging' is also greatly reduced...

[I discovered that the 'selecting which faces to remove' code could effectively go into a loop is some combinations of small island faces and therefore never resolve which were solid and which transparent (or at best take several weeks!) - this is now avoided because when all of the faces have been considered once it then stops and goes to the next step - I have found (so far) that it has never messed up the result by doing this, so the rechecking of the earlier versions is now shown to be an unnecessary frippery that slowed things down too].........

:ugeek:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer 20110105

Postby davidlouis » Mon Jan 10, 2011 3:41 pm

TIG

Some observations.
I am trying to use this to 'cut out' some people and so far the image trimmer is working just fine on my png's.
When using the simplifier however, it seems that when I have a group of people in one png file and they are seperated by clear space, running the sinplifier on the component, causes them to disappear!

Attached are example files... couple1a causes a disappearance whilst couple2a works fine.

I don't really want to seperate out all the individuals so I'm hoping you can help.

I assume that this is a bug and this would also happen when tracing a tree shape which has some leaves that are seperated from the branches in the alpha map / png??

Thanks

Dave
0

davidlouis 
 

Re: [Plugin] ImageTrimmer 20110105

Postby TIG » Tue Jan 11, 2011 12:29 am

davidlouis wrote:TIG

Some observations.
I am trying to use this to 'cut out' some people and so far the image trimmer is working just fine on my png's.
When using the simplifier however, it seems that when I have a group of people in one png file and they are seperated by clear space, running the sinplifier on the component, causes them to disappear!

Attached are example files... couple1a causes a disappearance whilst couple2a works fine.

I don't really want to seperate out all the individuals so I'm hoping you can help.

I assume that this is a bug and this would also happen when tracing a tree shape which has some leaves that are seperated from the branches in the alpha map / png??

Thanks

Dave
I can see the cause - it's a balance between loooong processing time and occasional errors... I'm formulating a fix [well on...] - in the meanwhile don't 'simplify' the outlines... :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer 20110105

Postby mbattler » Tue Jan 11, 2011 4:06 am

I am having trouble following the steps to get the end result.

Here are the steps I have done:
1) Imported the PNG image and then selected it.
2) In the tools menue selected the Edge trimer.
3) waited for the prompt boxes and said yes to each.

No new image appeared and my imported image remained unchanged? What am I missing ing steps? thank you.
0

mbattler 
 

Re: [Plugin] ImageTrimmer 20110105

Postby TIG » Tue Jan 11, 2011 9:06 am

mbattler wrote:I am having trouble following the steps to get the end result.
Here are the steps I have done:
1) Imported the PNG image and then selected it.
2) In the tools menu selected the ImageTrimmer.
3) Waited for the prompt boxes and said yes to each.
No new image appeared and my imported image remained unchanged? What am I missing steps? thank you.

The Image will not change - a copy will be made at the origin as a component trimmed with transparent areas removed.
Ensure your PNG image has clear solid/transparent areas...
Only say Yes to delete the original Image IF you want to lose it...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v1.8 20110111

Postby TIG » Tue Jan 11, 2011 10:51 am

Here's a link to get v1.8 viewtopic.php?p=293677#p293677
The glitch with some simplify operations is addressed and speed should have also improved...
Feedback please...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v1.8 20110111

Postby davidlouis » Tue Jan 11, 2011 6:36 pm

TIG

I have tested the new version on the previous 'trouble' file and its working just fine now... :)

Thanks... you've just saved me a heap of time.

Will let you know if any other issue pop up.

Thanks :thumb:

Dave
0

davidlouis 
 

Re: [Plugin] ImageTrimmer v1.8 20110111

Postby davidlouis » Wed Jan 19, 2011 10:01 pm

Hi TIG

I have just noticed that the components created using the image trimmer cannot receive shadows even if the option to do so is checked under entity info....

This seems to happen when a png is applied to the surface unlike say a jpg which does receive them... i've tried this with material texures and people.

Any ideas?

Also I have just noticed that a component set to always face the camera cannot receive shadows either??? this happens in skp 7 & 8... :o i have just never noticed till now... could this be a bug or is there some reason why this is the case...

I'm trying to build up a library of people and realised this when they wouldn't cast shadows on each other...
This can make some exported images look a bit strange especially when you expect to see something in shadow and it kind of pops out at you.

I appreciate any pearls of wisdom you might be able to offer on this.

Thanks

Dave
0

davidlouis 
 

Re: [Plugin] ImageTrimmer v1.8 20110111

Postby TIG » Wed Jan 19, 2011 11:25 pm

I never noticed that either.
A transparent PNG can't receive shadows !
However, a 'flattened' PNG [without transparency] or a JPG can...
Here's a fix - not ideal but it works...
Edit the component and with the eye-dropper pick its material in the Material Browser.
Edit that material.
[You need to have set you image-editor in Preferences - I use Gimp...]
It opens, save_as a JPG with the same name [note the folder***it's usually in your own 'Temp' folder***].
Now edit that material and change the texture to the JPG version...
Alternatively 'flatten' the PNG and save it.
NOW the material accepts shadows - since the image is trimmed to remove transparent its areas its 'PNGness is no longer useful - so a JPG works just fine !

I could automate that part in ImageTrimmer - I'm thinkings about it overnight..
.
The additional steps are that when the material is made with the PNG texture we have already exported it as a PNG file into the temp folder... so we simply convert that PNG file into a JPG/flattened-PNG file and we have an option to use that as the new material's image instead of the PNG...

EDIT: option to flatten the png now added to v1.9... :geek:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby TIG » Thu Jan 20, 2011 12:27 pm

Here's a link to get v1.9 viewtopic.php?p=293677#p293677

There is an added option to 'flatten' the new material's texture PNG [i.e. remove its transparency] so that the material will then receive shadows.

Feedback please...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby davidlouis » Sun Jan 23, 2011 2:31 pm

Hi TIG

Sorry for the delay in feedback...chaos at work so I didn't have time to 'experiment'.... Anyway... here's what's happening now...

If I choose the flatten image option, it does flatten it (evident by a flattened image in the trimmed files folder) but does not substitute the texture in the sketchup material for me. I have to sample the material and reselect the flattened image file manually via the material pallette. This is fine if you are opting to keep a copy of the trimmed files but is not if you choose to delete them...

I'm sure you were intending for this to happen automatically... ?

Otherwise despite this apparent hiccup, this plugin is fantastic! :thumb:

Looking forward to the next version.

Cheers
Dave
0

davidlouis 
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby TIG » Sun Jan 23, 2011 2:43 pm

davidlouis wrote:Hi TIG

Sorry for the delay in feedback...chaos at work so I didn't have time to 'experiment'.... Anyway... here's what's happening now...

If I choose the flatten image option, it does flatten it (evident by a flattened image in the trimmed files folder) but does not substitute the texture in the sketchup material for me. I have to sample the material and reselect the flattened image file manually via the material pallette. This is fine if you are opting to keep a copy of the trimmed files but is not if you choose to delete them...

I'm sure you were intending for this to happen automatically... ?

Otherwise despite this apparent hiccup, this plugin is fantastic! :thumb:

Looking forward to the next version.

Cheers
Dave

Can you run it with the Ruby Console open - it's working fine for me ???
Is this failing on PC and MAC ?
If you choose 'flatten' image it makes another png file in the TrimmedImages folder with [Flattened] in its name - that has no transparent pixels so it accepts shadows.
Then it uses that as the material's texture instead of the original one with transparency, scaled appropriately as before.
I can't see why it's working for me and not for you ?
Can you post the original transparent image png so I can test it :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby davidlouis » Sun Jan 23, 2011 6:10 pm

Here is a typical file that doesn't work on my side...
I suspect it is going to be something with the way it has been saved as a transparent png.
I am on PC.

Thanks

Dave
0

davidlouis 
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby davidlouis » Sun Jan 23, 2011 6:31 pm

Hi again TIG

Just tried again with ruby console open... 3 seperate images... no success.
This was the message:

quietly_force_sync_mats_cb just calledquietly_force_sync_mats_cb just calledquietly_force_sync_mats_cb just calledquietly_force_sync_mats_cb just calledquietly_force_sync_mats_cb just calledquietly_force_sync_mats_cb just calledERROR: skpHelperClasses.rb:updateSkpMaterial, unable to find a material called: kid041
quietly_force_sync_mats_cb just calledERROR: skpHelperClasses.rb:updateSkpMaterial, unable to find a material called: kid041
ERROR: skpHelperClasses.rb:updateSkpMaterial, unable to find a material called: kid041


with regard to the error about not being able to find the material kid041... there is no material or texture by this name....??

it then gets into a loop and keeps posting this...

I'm sure it means more to you than to me...

Cheers
Dave
0

davidlouis 
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby Dave R » Sun Jan 23, 2011 6:32 pm

David, I just tried it with your image. It worked for me just fine with no modification.
Kid2.jpg
0
Etaoin Shrdlu


%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby davidlouis » Sun Jan 23, 2011 8:20 pm

OK... so if its not the image itself then what about your external image editor...?

Which one do you have listed in your sketchup preferences? TIG mentioned his was Gimp... but I am using a Corel app...

Don't know if it will make any difference. :?
0

davidlouis 
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby Dave R » Sun Jan 23, 2011 8:24 pm

I don't know if it matters either. I don't have an image editor set in Preferences.

Out of curiosity, what happens if you download the image from your post and use it? Is it possible that something about it gets changed when it is uploaded to the forum?
0
Etaoin Shrdlu


%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby TIG » Sun Jan 23, 2011 8:51 pm

davidlouis wrote:Hi again TIG
Just tried again with ruby console open... 3 seperate images... no success.
This was the message:
quietly_force_sync_mats_cb just calledquietly_force_sync_mats_cb just calledquietly_force_sync_mats_cb just calledquietly_force_sync_mats_cb just calledquietly_force_sync_mats_cb just calledquietly_force_sync_mats_cb just calledERROR: skpHelperClasses.rb:updateSkpMaterial, unable to find a material called: kid041
quietly_force_sync_mats_cb just calledERROR: skpHelperClasses.rb:updateSkpMaterial, unable to find a material called: kid041
ERROR: skpHelperClasses.rb:updateSkpMaterial, unable to find a material called: kid041
with regard to the error about not being able to find the material kid041... there is no material or texture by this name....??
It then gets into a loop and keeps posting this...
I'm sure it means more to you than to me...
Cheers
Dave

All of those error messages are nothing to do with ImageTrimmer or raw Sketchup ??? What otehr tools do you have loaded that might manipulate materials in the background ? and thereby clash... :?

The external image editor doesn't matter...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby TIG » Sun Jan 23, 2011 8:57 pm

Your image also works 'fine' for me... although it didn't flatten and use [Flattened].png version as expected ???
Seeking reason...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby Dave R » Sun Jan 23, 2011 9:08 pm

TIG, I was prompted to "flatten" when I tried it. I wonder what is different.
0
Etaoin Shrdlu


%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby TIG » Sun Jan 23, 2011 9:17 pm

I have the reason - sometimes the flattened image wasn't ready to apply when it tried ... but now it waits until it is - an update is in the pipeline ;)
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ImageTrimmer v1.9 20110120

Postby davidlouis » Sun Jan 23, 2011 9:22 pm

Aha... So thats why the ruby console sometimes took a bit longer to display the progress of the process than other times
I did get it working on ocassion but could quite pinpoint the cause when it failed. When it worked the ruby console was quick to report... when it didn't, the console seemed a bit sluggish.

Great TIG... so i guess you have figured it out (hopefully)... :D
I'll wait for the update before trying again.

Thanks

Dave
0

davidlouis 
 

Re: [Plugin] ImageTrimmer v2.0 20110123

Postby TIG » Sun Jan 23, 2011 9:24 pm

Here's a link to get v2.0 viewtopic.php?p=293677#p293677

I have now sorted out the Flattened Image creation so that the new texture is not applied until it's 'fully-baked'. The earlier version sometimes jumped in too soon and the flattened-image file was 'half-baked' so it didn't get applied properly. It should now as it waits until it is 'fully-baked'...

Feedback please...
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: MakeItRein and 70 guests

Visit our sponsors: