Discussion:
"transition" blending adjacent blocks of gray
Rob Owens
2010-07-11 23:52:20 UTC
Permalink
I'm new to the list and not an expert on image terminology, so I
apologize if my post is confusing.

How can I take a 100x100 light gray square, overlap it by 20 pixels with
a 100x100 dark gray square, and have a smooth transition between the two
shades of gray. I don't want the 20x100 pixel transition to be medium
gray, I want it to smoothly transistion from light to dark gray.

My ultimate goal:

I'm trying to represent a matrix of numbers as an image. The numbers
will be from 0 to 1, and each number will be represented as a 100x100
square in a shade of gray. The idea is that a person can look at the
image and get an impression of the values in the matrix by how light or
dark the image is. I think hard transitions between squares will be
distracting, so I'd like smooth transitions.

Thanks for any advice you can give.

-Rob
John Culleton
2010-07-12 12:57:33 UTC
Permalink
Post by Rob Owens
I'm new to the list and not an expert on image
terminology, so I
Post by Rob Owens
apologize if my post is confusing.
How can I take a 100x100 light gray square, overlap it by
20 pixels with
Post by Rob Owens
a 100x100 dark gray square, and have a smooth
transition between the two
Post by Rob Owens
shades of gray. I don't want the 20x100 pixel transition to
be medium
Post by Rob Owens
gray, I want it to smoothly transistion from light to dark
gray.
Post by Rob Owens
I'm trying to represent a matrix of numbers as an image.
The numbers
Post by Rob Owens
will be from 0 to 1, and each number will be represented
as a 100x100
Post by Rob Owens
square in a shade of gray. The idea is that a person can
look at the
Post by Rob Owens
image and get an impression of the values in the matrix
by how light or
Post by Rob Owens
dark the image is. I think hard transitions between
squares will be
Post by Rob Owens
distracting, so I'd like smooth transitions.
Thanks for any advice you can give.
-Rob
For this kind of work I would use something like Gimp.
Blending one image or color into another is described in
books like "The Artist's Guide to Gimp Effects." a command
line program like ImageMagick would be a bit clumsy for
this task since the user is essentially working blind.

The user of Open Source software should have an array of
tools at hand, and not rely on one or two. I have on my
computer and use IM, Gimp, Scribus, TeX and GVim. I have
in reserve tools like Inkscape and Krita for tasks that may
come up in the future.
--
John Culleton
Wexford Press
"Create Book Covers with Scribus"
Printable E-book 38 pages $5.95
http://www.booklocker.com/books/4055.html
Rob Owens
2010-07-12 14:26:59 UTC
Permalink
Post by Rob Owens
Post by Rob Owens
I'm new to the list and not an expert on image
terminology, so I
Post by Rob Owens
apologize if my post is confusing.
How can I take a 100x100 light gray square, overlap it by
20 pixels with
Post by Rob Owens
a 100x100 dark gray square, and have a smooth
transition between the two
Post by Rob Owens
shades of gray. I don't want the 20x100 pixel transition to
be medium
Post by Rob Owens
gray, I want it to smoothly transistion from light to dark
gray.
Post by Rob Owens
I'm trying to represent a matrix of numbers as an image.
The numbers
Post by Rob Owens
will be from 0 to 1, and each number will be represented
as a 100x100
Post by Rob Owens
square in a shade of gray. The idea is that a person can
look at the
Post by Rob Owens
image and get an impression of the values in the matrix
by how light or
Post by Rob Owens
dark the image is. I think hard transitions between
squares will be
Post by Rob Owens
distracting, so I'd like smooth transitions.
Thanks for any advice you can give.
-Rob
For this kind of work I would use something like Gimp.
Blending one image or color into another is described in
books like "The Artist's Guide to Gimp Effects." a command
line program like ImageMagick would be a bit clumsy for
this task since the user is essentially working blind.
The user of Open Source software should have an array of
tools at hand, and not rely on one or two. I have on my
computer and use IM, Gimp, Scribus, TeX and GVim. I have
in reserve tools like Inkscape and Krita for tasks that may
come up in the future.
Actually, I'm trying to work this into a script where the user would
only have to enter the matrix of numbers. The script would then output
the image.

This is a work-related project that is intended for use by project
managers. The image is intended to be used in presentations, to make it
easier for management types to get a feel for project status w/o having
to digest a whole bunch of numerical analysis.

I know that it's possible to script the Gimp. I'll research it a bit.
Do you think it's likely to be easier than scripting ImageMagick?

-Rob
John Culleton
2010-07-12 17:04:32 UTC
Permalink
Post by Rob Owens
This is a work-related project that is intended for use by
project
Post by Rob Owens
managers. The image is intended to be used in
presentations, to make it
Post by Rob Owens
easier for management types to get a feel for project
status w/o having
Post by Rob Owens
to digest a whole bunch of numerical analysis.
I know that it's possible to script the Gimp. I'll research it a bit.
Do you think it's likely to be easier than scripting
ImageMagick?
Post by Rob Owens
-Rob
_______________________________________________
Magick-users mailing list
http://studio.imagemagick.org/mailman/listinfo/magick-
users

I don't know how I would script this function for third party
users, in Gimp or in ImageMagick. Someone else will need
to discuss that aspect.

Interactively blending one color or shade into another at
the border as you require could be done in two different
ways in Gimp.



1. Create a gradient from one shade to the other and create
markers to indicate start and finish of the blend area.

2. In the more general case you can use a gradient to create
a layer mask that causes one layer to fade away and the
layer below it to become visible.
--
John Culleton
Wexford Press
"Create Book Covers with Scribus"
Printable E-book 38 pages $5.95
http://www.booklocker.com/books/4055.html
Fred Weinhaus
2010-07-12 16:04:39 UTC
Permalink
Post by Rob Owens
How can I take a 100x100 light gray square, overlap it by 20 pixels with
a 100x100 dark gray square, and have a smooth transition between the two
shades of gray. I don't want the 20x100 pixel transition to be medium
gray, I want it to smoothly transistion from light to dark gray.
convert -size 100x100 xc:"gray(25%)" gray1.png
convert -size 100x100 xc:"gray(75%)" gray2.png

convert gray1.png[80x100+0+0] \( -size 100x20
gradient:"gray(75%)-gray(25%)" -rotate 90 \) gray2.png[80x100+0+0]
+append gray_gradient.png
Rob Owens
2010-07-16 01:49:55 UTC
Permalink
Post by Fred Weinhaus
Post by Rob Owens
How can I take a 100x100 light gray square, overlap it by 20 pixels with
a 100x100 dark gray square, and have a smooth transition between the two
shades of gray. I don't want the 20x100 pixel transition to be medium
gray, I want it to smoothly transistion from light to dark gray.
convert -size 100x100 xc:"gray(25%)" gray1.png
convert -size 100x100 xc:"gray(75%)" gray2.png
convert gray1.png[80x100+0+0] \( -size 100x20
gradient:"gray(75%)-gray(25%)" -rotate 90 \) gray2.png[80x100+0+0]
+append gray_gradient.png
Thanks everyone for all the good advice on this thread. I'm on vacation
right now, but will test out all the suggestions and report back.

-Rob

Anthony Thyssen
2010-07-12 23:20:10 UTC
Permalink
On Sun, 11 Jul 2010 19:52:20 -0400
magick-users-***@imagemagick.org wrote:
| I'm new to the list and not an expert on image terminology, so I
| apologize if my post is confusing.
|
| How can I take a 100x100 light gray square, overlap it by 20 pixels with
| a 100x100 dark gray square, and have a smooth transition between the two
| shades of gray. I don't want the 20x100 pixel transition to be medium
| gray, I want it to smoothly transistion from light to dark gray.
|
| My ultimate goal:
|
| I'm trying to represent a matrix of numbers as an image. The numbers
| will be from 0 to 1, and each number will be represented as a 100x100
| square in a shade of gray. The idea is that a person can look at the
| image and get an impression of the values in the matrix by how light or
| dark the image is. I think hard transitions between squares will be
| distracting, so I'd like smooth transitions.
|
| Thanks for any advice you can give.
|

First the better place to get help is to use the IM Discussion Forum
http://www.imagemagick.org/discourse-server/viewforum.php?f=1

However as for your problme have a look at ImageMagick Examples,
Photo Handling, Overlapping Photos
http://www.imagemagick.org/Usage/photos/#overlap

You may also like to look at
Multi-Image Layers, and specifically Examples of Layering images
http://www.imagemagick.org/Usage/layers/#example

For Thumbnails, and adding frames, padding, fading around images see
http://www.imagemagick.org/Usage/thumbnails/#fluff



Anthony Thyssen ( System Programmer ) <***@griffith.edu.au>
--------------------------------------------------------------------------
"Here, you're a zombie!"
"That's right, kick a man when he's dead." said Constable Shoe sharply
-- Terry Pratchett, "Jingo"
--------------------------------------------------------------------------
Anthony's Castle http://www.cit.griffith.edu.au/~anthony/
Loading...