Plotter software - Suse

This is a discussion on Plotter software - Suse ; 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 ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Plotter software

  1. Plotter software

    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

  2. Re: Plotter software

    houghi 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.
    >
    > 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.

  3. Re: Plotter software

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

    > 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

  4. Re: Plotter software

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


    > 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

  5. Re: Plotter software

    houghi 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?

    #!/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)

  6. Re: Plotter software

    Huibert Bol wrote:
    > houghi 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.

    > #!/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

  7. Re: Plotter software

    houghi wrote:

    > 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)

+ Reply to Thread