How to make the grass greener

Post questions on how to use or achieve an effect in Inkscape.
Propane13
Posts: 3
Joined: Mon Jun 11, 2012 9:58 pm

How to make the grass greener

Postby Propane13 » Mon Jun 11, 2012 10:07 pm

Hello!

I've been stuck on the same problem for a few days now, and could really use some help.

Awhile back, I found a tutorial for a competitor product about how to make grass greener:
http://www.techknowsys.com/portfolio/Ph ... grass.aspx
It's a problem that I want to try to solve on a pattern that I already have imported, but can't seem to get it working in Inkscape.

I have done my searching, and found a few methods that seem like they could work, but in my mind the seem overly complicated, and with a high learning curve for such a simple operation. For example, here's one way I found out how to do it:
!) Filters->Color->Tritone
2) Filters->Filter Editor
3) The Matrix has these values-- change them:
1.00 0.00 0.00 0.00
1.00 0.00 0.00 0.00
1.00 0.00 0.00 0.00
1.00 0.00 0.00 1.00

In my opinion, this seems way too complicated for what I want to do-- there's a lot of values here I don't understand for something simple like "make the value of green a little darker". And, my attempts to change the values have just made things turn black or purple. So, I guess I'd need to read up on this more, but I'm thinking this is over-engineering the problem I need to solve.

More searching told me that I can open up a pattern in an xml editor and edit the colors that way (with control-shift-X), but I couldn't find documentation as to what all of the metadata in xml meant, so that didn't work for me either.

Fill and Stroke pattern changing seems to completely destroy the pattern itself. Though, I could swear that I've used that function before to change values.

I guess none of these seem to match the above-mentioned link which says to make 2 layers (one with a color, one with the pattern), and blend them together. Can that be done in Inkscape? I'd love to hear an expert opinion to help me get past this problem.

Thanks!

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: How to make the grass greener

Postby brynn » Tue Jun 12, 2012 3:50 am

Welcome to the forum!

If it's a photo you have, and you need to make the grass look greener, that would probably better be done in a photo editing program. That may be why you're having so much trouble finding info. Inkscape can't do it easily. Is there some reason that you need a vector editor like Inkscape? There is another free and open source graphics program that would probably be better for this. Look up The GIMP http://www.gimp.org/

If you have to have a vector editor, for some reason, we could probably come up with something. But a raster editor like GIMP would be a better choice. Let us know :D

Propane13
Posts: 3
Joined: Mon Jun 11, 2012 9:58 pm

Re: How to make the grass greener

Postby Propane13 » Tue Jun 12, 2012 6:00 am

Thanks for the reply!
And, it's good to be a part of the forums.

A little backstory-- I started a project about a year ago in Google Sketchup-- it was a good tool, but had some problems when drawing circles.
If you zoom waaaay in to the circles in that tool, they are represented as a series of small line-segments. It's hard to notice unless you zoom way in.

It was this fault that led me to look at other tools, since essentially, I need to be able to make a set of curvy lines that I could print at different scales without any loss.
Inkscape came to my rescue. I will admit that the learning curve is pretty heavy, but after lots of trial and error and browsing, I was able to make what I needed.
Now that I have my raw curves / circles all drawn up, the next step that I had was to put some textures on a few surfaces, just to make things clean.

I guess I could take what I have, export it to gimp (also a very good tool), and do the work there, but I figure that I've already done 90% of the work.
But, wait a sec-- maybe you're right. Maybe the best solution will be to open the texture that I've defined in gimp, tweak it there, and then save and import that into Inkscape for filling in as a texture.
I did not consider that as an option, but maybe that's the direction to go. Maybe using 2 tools in this case is the right decision.

I'll consider that as the path to go (seems it may be easiest), but I'll leave the question here in case anyone that feels led to try to make this work.
If it gets figured out, I'd definitely be adding this to my arsenal of tricks. :)

Thanks for the response!

v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

Re: How to make the grass greener

Postby v1nce » Tue Jun 12, 2012 7:05 am

Tritone filter is a bit complicated, look at the attached svg instead

to make the grass greener :

. Draw a shape that follows the grass shape + give it a green color (like in original tutorial)
. You need to edit the svg : shift ctrl X add the following entry "enable-background" with value "new" in the root svg
(sorry it's very user unfriendly but it has to be done until the bug is fixed https://bugs.launchpad.net/inkscape/+bug/189341 vote for it)

No you need to blend your image and the shape that is over.
. select the shape
. create a new filter
. click the new filter to apply it to the currently slected shape (right now you see nothing because the filter is empty)
. add a composite operator ; link to background image and source image ;
go to filter parameters choose arithmetic.
start with
k1 = 0
k2 = 0.5
k3 = 0.5
k4 = 0

increase k2 if you want more of the background image (more detail)
increase k3 if you want more of the source image (plain color)
increase k4 if you want to make your image brighter
k1 mixes (= multiply) source and background so you got the color and the detail

you can decrease too ;)

The filter applies to the bounding box. If you want it to affect only the shape, you need to
add a new composite ; link to output of preceeding filter and source image ; choose "in" operator
Attachments
house.svg
(73.47 KiB) Downloaded 174 times
Last edited by v1nce on Wed Jun 13, 2012 3:20 am, edited 1 time in total.

v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

Re: How to make the grass greener

Postby v1nce » Tue Jun 12, 2012 7:36 am

Propane13 wrote:
For example, here's one way I found out how to do it:
!) Filters->Color->Tritone
2) Filters->Filter Editor
3) The Matrix has these values-- change them:
1.00 0.00 0.00 0.00
1.00 0.00 0.00 0.00
1.00 0.00 0.00 0.00
1.00 0.00 0.00 1.00

In my opinion, this seems way too complicated for what I want to do-- there's a lot of values here I don't understand for something simple like "make the value of green a little darker".


This matrix is a tweak : it sums r,g,b channels value and store them into the red one.
(Later it will do the same for green, then blue and will start combining them)

You'd better start a new filter with the identity matrix
Ri Gi Bi Oi c
Ro:1 0 0 0 0
Go:0 1 0 0 0
Bo:0 0 1 0 0
Oo:0 0 0 1 0

o = output, i = input, c =constant
we will not care with last line coz its opacity

if you want to boost the blue x2
1 0 0 0 0
0 1 0 0 0
0 0 2 0 0

if you want to swap red and green
0 1 0 0 0
1 0 0 0 0
0 0 1 0 0

if you want to make green darker (/2)
1 0 0 0 0
0 0.5 0 0 0
0 0 1 0 0

with this matrix
a light green (0,1,0) will become (0,0.5 ,0) medium green
a medium (0,0.5,0) will become (0,0.25,0) dark green
a dark (0,0.25,0) will become (0,0.125,0) really dark green


or you can do it like this too
1 0 0 0 0
0 1 0 0 -0.5
0 0 1 0 0
a light green (0,1,0) will become (0, 1-0.5 ,0) = (0, 0.5 ,0) medium green
a medium (0,0.5,0) will become (0, 0.5-0.5 ,0) = (0,0,0) black
a dark (0,0.25,0) will become (0, 0.25-0.5,0) = (0,0,0) black (there can't be negative value)
Last edited by v1nce on Wed Jun 13, 2012 3:21 am, edited 1 time in total.

Propane13
Posts: 3
Joined: Mon Jun 11, 2012 9:58 pm

Re: How to make the grass greener

Postby Propane13 » Tue Jun 12, 2012 10:56 am

This is it!

Thank you for solving my conundrum.
It feels really good to have many frustrated hours finally making a little bit of sense.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: How to make the grass greener

Postby ~suv » Tue Jun 12, 2012 7:41 pm

v1nce wrote:. You need to edit the svg : shift ctrl X add the following entry "enable-background" with value "new" in the root svg
(sorry it's very user unfriendly but it has to be done until the bug is fixed (…))

A simpler way to have the background enabled for filter effects:
  1. open the 'Layers…' dialog,
  2. enable a 'Blend' mode for the current layer and then
  3. set it back to 'Normal' again.

    This will add the required attribute to the top-level <svg> node (and won't remove it if the blend mode is set to 'Normal' again).


Return to “Help with using Inkscape”