www.smartbusinesschoices.com

Leading Business and Technology,
News and information


Part of the Identityscape.com network...

getxfactor.com jmoodmusic.com smartbusinesschoices.com mintdepot.com lowfaresalways.com evangelicalview.com shoppingpodder.com soproudlywehail.com webnews.ws currenthumor.com

 

 

Plotter software
   Smart Linux Business Choices! - the Best of UseNet Postings! Forum Index -> Linux - Suse Forum  
View previous topic :: View next topic  
Author Message
houghi
Guest






PostPosted: Wed Oct 29, 2008 11:07 pm    Post subject: Plotter software Reply with quote

I have a script that does the following. It writes the following:

....
rgb(10,20,30) 200 300
rgb(10,20,31) 150 700
....

The idea is that it does this for the colors 0,0,0 till 255,255,255. The
last two numbers are where it should be on a 1920x1200 image. What I
want to do is turn those numbers into an image.

I asume that a plotter program would be best to do this.

Anybody an idea of what program to use or any other idea of how to turn
the numbers into an image.

Obviously if needed, the output of the numbers can be changed. The main
thing is that it keeps colour and location. The object is to veryfy
randomness.

houghi
--
Remind me to write an article on the compulsive reading of news. The
theme will be that most neuroses can be traced to the unhealthy habit
of wallowing in the troubles of five billion strangers. -- Heinlein
Back to top
Michael Soibelman
Guest






PostPosted: Thu Oct 30, 2008 12:27 am    Post subject: Re: Plotter software Reply with quote

houghi wrote:

Quote:
I have a script that does the following. It writes the following:

...
rgb(10,20,30) 200 300
rgb(10,20,31) 150 700
...

The idea is that it does this for the colors 0,0,0 till 255,255,255. The
last two numbers are where it should be on a 1920x1200 image. What I
want to do is turn those numbers into an image.

I asume that a plotter program would be best to do this.

Anybody an idea of what program to use or any other idea of how to turn
the numbers into an image.

Obviously if needed, the output of the numbers can be changed. The main
thing is that it keeps colour and location. The object is to veryfy
randomness.

houghi

Try this:

http://www.gnu.org/software/hp2xx/hp2xx.html

Available in the Main (OSS) repo. [hp2xx]

Works with hp laserjet/deskjet and I am assuming large format plotters as
well. Been meaning to set this up for a while but I'll need to purchase an
adapter for my old plotter to serial port connector first.
Back to top
SINNER
Guest






PostPosted: Thu Oct 30, 2008 1:41 am    Post subject: Re: Plotter software Reply with quote

* houghi wrote in alt.os.linux.suse:

Quote:
I have a script that does the following. It writes the following:

...
rgb(10,20,30) 200 300
rgb(10,20,31) 150 700
...

The idea is that it does this for the colors 0,0,0 till 255,255,255. The
last two numbers are where it should be on a 1920x1200 image. What I
want to do is turn those numbers into an image.

I asume that a plotter program would be best to do this.

Anybody an idea of what program to use or any other idea of how to turn
the numbers into an image.

Obviously if needed, the output of the numbers can be changed. The main
thing is that it keeps colour and location. The object is to veryfy
randomness.

houghi

Like so?

http://www.cs.ucsd.edu/~mtelgars/old/cug.html

Or less of a grapher?

--
David
Back to top
houghi
Guest






PostPosted: Thu Oct 30, 2008 2:05 am    Post subject: Re: Plotter software Reply with quote

Michael Soibelman wrote:
Quote:
I asume that a plotter program would be best to do this.
snip
Try this:

http://www.gnu.org/software/hp2xx/hp2xx.html

Available in the Main (OSS) repo. [hp2xx]

Works with hp laserjet/deskjet and I am assuming large format plotters as
well. Been meaning to set this up for a while but I'll need to purchase an
adapter for my old plotter to serial port connector first.

I think you misunderstood. I am looking for a plotter program, not a
plotter driver.

houghi
--
This was written under the influence of the following:
| Artist : Jimi Hendrix
| Song : Hey Joe
| Album : Jimi Hendrix
Back to top
Huibert Bol
Guest






PostPosted: Thu Oct 30, 2008 2:10 am    Post subject: Re: Plotter software Reply with quote

houghi <houghi@houghi.org.invalid> wrote:

Quote:
I have a script that does the following. It writes the following:

...
rgb(10,20,30) 200 300
rgb(10,20,31) 150 700
...

The idea is that it does this for the colors 0,0,0 till 255,255,255. The
last two numbers are where it should be on a 1920x1200 image. What I
want to do is turn those numbers into an image.

Just pixels?

#!/usr/bin/perl

use Image::Magick;

$image = Image::Magick->new(size=>'1920x1200');
$image->ReadImage('xc:black');

while(<>) {
if (/rgb\((\d+),(\d+),(\d+)\) (\d+) (\d+)/) {
$color = sprintf("#%02x%02x%02x", $1, $2, $3);
$image->Set("pixel[$4,$5]"=>$color);
}
}

$image->Write('image.png');


--
Huibert
"Hey! HEY! Curious cat, here!" -- Krosp I (GG)
Back to top
houghi
Guest






PostPosted: Thu Oct 30, 2008 4:28 am    Post subject: Re: Plotter software Reply with quote

Huibert Bol wrote:
Quote:
houghi <houghi@houghi.org.invalid> wrote:

I have a script that does the following. It writes the following:

...
rgb(10,20,30) 200 300
rgb(10,20,31) 150 700
...

The idea is that it does this for the colors 0,0,0 till 255,255,255. The
last two numbers are where it should be on a 1920x1200 image. What I
want to do is turn those numbers into an image.

Just pixels?

Yes.

Quote:
#!/usr/bin/perl

use Image::Magick;

$image = Image::Magick->new(size=>'1920x1200');
$image->ReadImage('xc:black');

while(<>) {
if (/rgb\((\d+),(\d+),(\d+)\) (\d+) (\d+)/) {
$color = sprintf("#%02x%02x%02x", $1, $2, $3);
$image->Set("pixel[$4,$5]"=>$color);
}
}

$image->Write('image.png');

Can't locate Image/Magick.pm so installed perl-perlmagick.

And to make it easier I could even make the file:
10 20 30 200 300
10 20 31 150 700

As I know nothing about perl, I am asuming here.
while (<>) {
$color = sprintf("#%02x%02x%02x", $1, $2, $3);
$image->Set("pixel[$4,$5]"=> $color);
}

Is that correct (Before I start making the file)

houghi
--
Filled with mingled cream and amber I will drain that glass again. Such
hilarious visions clamber Through the chambers of my brain -- Quaintest
thoughts -- queerest fancies Come to life and fade away; Who cares how
time advances? I am drinking ale today. -- Edgar Allan Poe
Back to top
Huibert Bol
Guest






PostPosted: Thu Oct 30, 2008 6:40 pm    Post subject: Re: Plotter software Reply with quote

houghi <houghi@houghi.org.invalid> wrote:

Quote:
And to make it easier I could even make the file:
10 20 30 200 300
10 20 31 150 700

As I know nothing about perl, I am asuming here.
while (<>) {
$color = sprintf("#%02x%02x%02x", $1, $2, $3);
$image->Set("pixel[$4,$5]"=> $color);
}

Is that correct (Before I start making the file)

Perl isn't awk, you have to put in some more effort.

while(<>) {
($r, $g, $b, $x, $y) = split;
$color = sprintf("#%02x%02x%02x", $r, $g, $b);
$image->Set("pixel[$x,$y]"=> $color);
}

On the upside, naming the variables makes it slightly more readable.

Side note: I no next to nothing about ImageMagick, most of the script is
just voodoo programming based upon it's documentation.

--
Huibert
"Hey! HEY! Curious cat, here!" -- Krosp I (GG)
Back to top
Ulick Magee
Guest






PostPosted: Thu Nov 13, 2008 4:13 am    Post subject: Re: Plotter software Reply with quote

houghi wrote:
Quote:

Obviously if needed, the output of the numbers can be changed. The main
thing is that it keeps colour and location. The object is to veryfy
randomness.

Reminds me (if I understand correctly what you are trying to do) of this:

http://www.worldofspectrum.org/ZXBasicManual/zxmanchap16.html

"Run this program:

10 POKE 22527+RND*704, RND*127
20 GO TO 10


Never mind how this works; it is changing the colours of squares on the
television screen and the RNDs should ensure that this happens randomly.
The diagonal stripes that you eventually see are a manifestation of the
hidden pattern in RND - the pattern that makes it pseudorandom instead
of truly random."

Basically the code means 'take a "random" square on the screen, and make
it a "random" colour'.

It started out looking pretty random, but after a few minutes you ended
up with a series of diagonal blue/red/black stripes instead of a
'random' pattern, because of the pseudo-random nature of 'random'
numbers generated by computer.



--

Ulick Magee

Free software and free formats for free information for free people.
Open Office for Windows/OSX/Linux: http://www.openoffice.org
OpenSUSE Linux: http://en.opensuse.org
Back to top
Display posts from previous:   
   Smart Linux Business Choices! - the Best of UseNet Postings! Forum Index -> Linux - Suse Forum  
Page 1 of 1
All times are GMT

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum