Yup, that's right.
Ok, so that's what you mean by shading layer. I was thinking of shading layer as the color behind the brush. But then I see. And the shadows are that which are coming out from the tree, and falling on the ground. (Not shadows in the tree, right?)
Here is an updated versjon. Now it correctly removes trees showing through other trees. (It's still a bit buggy, creating outlines around the trees, but that's only a problem with the images)
Scaling is up next, and a GUI...
Ok, checked out your new version and it works great. There are no trees overlapping others from above so mission accomplished on that score.
However, I know you said it's a little buggy but I noticed one thing you might not be aware of. The only way I could get anything to save from it was to overwrite another file. It won't save an image if I give it a name such as "Treetest.png" unless that file already exists. Not a huge problem I guess now I've worked out how to get around it but I guess something you want to fix.
Another thing I noticed that you might want to adjust is when you click the "fill" checkbox it redraws the whole image randomly again. I know that this is how you've intended it but if you can somehow make it so that clicking the "fill" checkbox just leaves the same image but with a masking background that would be awesome.
The layer WITHOUT the background is good because you can do more with it as far as blend modes go. However, if you wanted to paint a colour behind it it is awkward because of the transparency of the image. Having another version of the same image that you can use as a mask, the filled layer, would be great for manipulating whatever layers you want to under your elements. I say again, that would be awesome.
LOVING your work on this by the way and I'm REALLY looking forward to you refining this further. I know that I for one will be using this tool as I'm sure will a lot of others. I'll rep you again as soon as I can.
Whoops... Added an if test which only saves if the file exists, and the user presses yes. But it should indeed save if the file does not exist. heh... Better add that back in.
I plan on doing that later. It's not difficult. The only problem is the GUI. I'm not quite sure how I should build it up, and how I should present the information. I have a GUI class at school, but I'm not sure if we are going to learn much.. It's very basic, and not in Java. But I'll see what I can do. Right now it's scaling functionality I'm working on.
I'm not sure you need that much of a GUI for this. You already have a basic one with a few buttons you can press and all it needs is a few more I would say.
I guess once you get the code in for altering the size of the brushes then the easiest thing to do would be to have two edit boxes, one for minimum size and one for maximum size.
Maybe a slider would work for forest density but if that is too much hassle then a simple button that changes the status from things like:
...and then back to the beginning again so you can rotate around the settings would do just fine.
Also I think another checkbox to say whether overlapping trees should be turned off would be a nice feature.
Umm... that's about it in its basic form. If you can fulfil my wish of having it do layers for shading and shadows then you might need an extra UI element for defining where the separate brushes should be placed in relation to each other but that's not needed right now I guess.
Edit: Also, could you upload your source code for your latest version too? I've never learned Java but I know enough of Pascal/Delphi to understand enough of what you are doing, even if I don't know all the commands/syntax exactly. I'd be interested to see how you solved the overlapping trees.
I'll include some sliders to change size and density. Zooming and panning is already implemented.
As I said, if you could provide me with a set of images where the outline and shading are separated, I'll try to work something out. But right now scaling and density is a bitch..
I know what I want, it's just the math that's confusing.
Ok, I think the scaling works now. But I can't do anything about the density. I just don't really know how I should do it. Might ponder out a way later. Also, the fill acts weird when it's resized.. don't know why.
All in all, I think it's at least usable now.
(And the source is so messy you probably won't understand anything. What I do is I divide the canvas up into a grid, and draw a tree over 16 of those. For the next tree I check if the grid I'm painting over is already filled. If it's not, then I draw the next tree.
The tree goes a little beyond the 16 tiles, so there is a small overlap in several places. But no large overlaps.)
Yes, your scale seems to work although I'm finding the placement of trees are not as good as they were previously. Some are overlapping in, not ncessarily wrong positions but places that don't look too good. I've definitely seen at least one tree that was higher than some others yet overlapping them too.
The trouble with the slider is it makes the refresh slow and also all the trees are the same size still. I'd say that if you want to keep the slider then only make it refresh the image when "Generate" is pressed again.
That still doesn't fix the fact that all the trees are the same size though. I guess a quick workaround for that though is to change the brushes so that some of them are different size to begin with.
I thought your "Fill" button was broken to start off with but then I realised you were just showing the mask layer which is what I requested so good stuff on that.
I have some thoughts on how to solve your placement problems but I'll just go whip up a few example images first and you can then tell me if it's crap or it can help.