Re: [Gimp-user] Newbie perl-gimp question

2009-01-15 Thread Owen
 Hi guys,

 I finally got Gimp installed and running for the purpose of writing a
 web
 application with image manipulation in perl.

 I've been scouring documentation and found a few useful tutorials. But
 I
 still don't have a complete picture.

 My first script (see below; I am running it from a shell) dies on save
 (I
 tried file_gif_save  file_bmp_save. Both fail. What am I doing wrong?
 What's a good place to find a tutorial that's directed specifically at
 stand-alone perl-server applications?

 Thanks for the help!
 Kate

 
 Here is my sample script:

 #!/usr/bin/perl
 use Gimp qw(:auto );
 use strict;

 Gimp::set_trace(TRACE_ALL);
 sub do_stuff{
my $size = '100x100';
my $color = #00;
my $img = gimp_image_new($size, $size, RGB);
my $layer = gimp_layer_new($img, $size, $size, RGB,
 Layer 1, 100, NORMAL_MODE);
gimp_image_add_layer($img, $layer, -1);
gimp_palette_set_background($color);
my $out = 'out.gif';
 #  file_gif_save(RUN_NONINTERACTIVE, $img, $layer, $out, $out, 0, 0,
 0, 0);
file_bmp_save(RUN_NONINTERACTIVE, $img, $layer, $out, $out);
 }







Out of curiosity, I ran that and it gave the following output. (I only
added warnings and diagnostics)




o...@eight-ten:~/Perlscripts$ perl dostuff
gimp_image_new(
INT32 width=100 The width of the image (1 = width = 262144)
INT32 height=100The height of the image (1 = height
= 262144)
INT32 type=0The type of image { RGB (0), GRAY (1),
INDEXED (2) }
) = (
IMAGE image=1   The ID of the newly created image
)
gimp_layer_new(
IMAGE image=1   The image to which to add the layer
INT32 width=100 The layer width (1 = width = 262144)
INT32 height=100The layer height (1 = height =
262144)
INT32 type=0The layer type { RGB-IMAGE (0), RGBA-IMAGE
(1), GRAY-IMAGE (2), GRAYA-IMAGE (3), INDEXED-IMAGE (4),
INDEXEDA-IMAGE (5) }
STRING name=Layer 1   The layer name
FLOAT opacity=100.00The layer opacity (0 =
opacity = 100)
INT32 mode=0The layer combination mode { NORMAL-MODE (0),
DISSOLVE-MODE (1), BEHIND-MODE (2), MULTIPLY-MODE (3),
SCREEN-MODE (4), OVERLAY-MODE (5), DIFFERENCE-MODE (6),
ADDITION-MODE (7), SUBTRACT-MODE (8), DARKEN-ONLY-MODE (9),
LIGHTEN-ONLY-MODE (10), HUE-MODE (11), SATURATION-MODE (12),
COLOR-MODE (13), VALUE-MODE (14), DIVIDE-MODE (15), DODGE-MODE
(16), BURN-MODE (17), HARDLIGHT-MODE (18), SOFTLIGHT-MODE
(19), GRAIN-EXTRACT-MODE (20), GRAIN-MERGE-MODE (21),
COLOR-ERASE-MODE (22), ERASE-MODE (23), REPLACE-MODE (24),
ANTI-ERASE-MODE (25) }
) = (
LAYER layer=2   The newly created layer
)
gimp_image_add_layer(
IMAGE image=1   The image
LAYER layer=2   The layer
INT32 position=-1   The layer position
) = (
)
gimp_palette_set_background(
COLOR background=[1.00,1.00,0.00,1.00]  The
background color
) = (
)
file_bmp_save(
INT32 run-mode=1Interactive, non-interactive
IMAGE image=1   Input image
DRAWABLE drawable=2 Drawable to save
STRING filename=out.gif   The name of the file to save
the image in
STRING raw-filename=out.gif   The name entered
) = (
)


o...@eight-ten:~/Perlscripts$ ls -l out*
-rw-r--r-- 1 owen owen 30054 2009-01-15 19:15 out.gif



As you see, all went well and out.gif was produced.

Is your directory for out.gif writable?




Owen

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Newbie perl-gimp question

2009-01-15 Thread Kate T Yoak
Thanks Owen for trying it! I was able to sort of focus and try figuring out
what's going on with my system instead of googling madly for what the hell
am I doing wrong with gimp?  :-)

I haven't figured out *everything* that was going wrong yet. But I think
there were two separate issues: one is, the server never got a chance to
initialize its directories, so it couldn't write the output. When I killed
the server, the bmp file wrote correctly! And once I added conversion to an
indexed format, the gif was created!!! I am so happy, I don't know what to
do with myself.

Well, there is one thing I can do, I suppose - figure out how to set up the
overall environment.

I'll post it as a separate question, though.

Thanks again!
Kate

 -Original Message-
 From: Owen [mailto:rc...@pcug.org.au] 
 Sent: Thursday, January 15, 2009 12:22 AM
 To: Kate T Yoak
 Cc: gimp-user@lists.xcf.berkeley.edu
 Subject: Re: [Gimp-user] Newbie perl-gimp question
 
 
  Hi guys,
 
  I finally got Gimp installed and running for the purpose of 
 writing a 
  web application with image manipulation in perl.
 
  I've been scouring documentation and found a few useful 
 tutorials. But 
  I still don't have a complete picture.
 
  My first script (see below; I am running it from a shell) 
 dies on save 
  (I tried file_gif_save  file_bmp_save. Both fail. What am I doing 
  wrong? What's a good place to find a tutorial that's directed 
  specifically at stand-alone perl-server applications?
 
  Thanks for the help!
  Kate
 
  
  Here is my sample script:
 
  #!/usr/bin/perl
  use Gimp qw(:auto );
  use strict;
 
  Gimp::set_trace(TRACE_ALL);
  sub do_stuff{
 my $size = '100x100';
 my $color = #00;
 my $img = gimp_image_new($size, $size, RGB);
 my $layer = gimp_layer_new($img, $size, $size, RGB,
  Layer 1, 100, NORMAL_MODE);
 gimp_image_add_layer($img, $layer, -1);
 gimp_palette_set_background($color);
 my $out = 'out.gif';
  #  file_gif_save(RUN_NONINTERACTIVE, $img, $layer, $out, 
 $out, 0, 0, 
  0, 0);
 file_bmp_save(RUN_NONINTERACTIVE, $img, $layer, $out, $out); }
 
 
 
 
 
 
 
 Out of curiosity, I ran that and it gave the following output. (I only
 added warnings and diagnostics)
 
 
 
 
 o...@eight-ten:~/Perlscripts$ perl dostuff
 gimp_image_new(
 INT32 width=100 The width of the image (1 = width 
 = 262144)
 INT32 height=100The height of the image (1 = height
 = 262144)
 INT32 type=0The type of image { RGB (0), GRAY (1),
 INDEXED (2) }
 ) = (
 IMAGE image=1   The ID of the newly created image
 )
 gimp_layer_new(
 IMAGE image=1   The image to which to add the layer
 INT32 width=100 The layer width (1 = width = 262144)
 INT32 height=100The layer height (1 = height =
 262144)
 INT32 type=0The layer type { RGB-IMAGE (0), RGBA-IMAGE
 (1), GRAY-IMAGE (2), GRAYA-IMAGE (3), INDEXED-IMAGE (4),
 INDEXEDA-IMAGE (5) }
 STRING name=Layer 1   The layer name
 FLOAT opacity=100.00The layer opacity (0 =
 opacity = 100)
 INT32 mode=0The layer combination mode { NORMAL-MODE (0),
 DISSOLVE-MODE (1), BEHIND-MODE (2), MULTIPLY-MODE (3),
 SCREEN-MODE (4), OVERLAY-MODE (5), DIFFERENCE-MODE (6),
 ADDITION-MODE (7), SUBTRACT-MODE (8), DARKEN-ONLY-MODE (9),
 LIGHTEN-ONLY-MODE (10), HUE-MODE (11), SATURATION-MODE (12),
 COLOR-MODE (13), VALUE-MODE (14), DIVIDE-MODE (15), DODGE-MODE
 (16), BURN-MODE (17), HARDLIGHT-MODE (18), SOFTLIGHT-MODE
 (19), GRAIN-EXTRACT-MODE (20), GRAIN-MERGE-MODE (21),
 COLOR-ERASE-MODE (22), ERASE-MODE (23), REPLACE-MODE (24),
 ANTI-ERASE-MODE (25) }
 ) = (
 LAYER layer=2   The newly created layer
 )
 gimp_image_add_layer(
 IMAGE image=1   The image
 LAYER layer=2   The layer
 INT32 position=-1   The layer position
 ) = (
 )
 gimp_palette_set_background(
 COLOR background=[1.00,1.00,0.00,1.00]  The
 background color
 ) = (
 )
 file_bmp_save(
 INT32 run-mode=1Interactive, non-interactive
 IMAGE image=1   Input image
 DRAWABLE drawable=2 Drawable to save
 STRING filename=out.gif   The name of the file to save
 the image in
 STRING raw-filename=out.gif   The name entered
 ) = (
 )
 
 
 o...@eight-ten:~/Perlscripts$ ls -l out*
 -rw-r--r-- 1 owen owen 30054 2009-01-15 19:15 out.gif
 
 
 
 As you see, all went well and out.gif was produced.
 
 Is your directory for out.gif writable?
 
 
 
 
 Owen
 
 

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Newbie perl-gimp question

2009-01-14 Thread Kate T Yoak
Hi guys,

I finally got Gimp installed and running for the purpose of writing a web
application with image manipulation in perl.

I've been scouring documentation and found a few useful tutorials. But I
still don't have a complete picture.

My first script (see below; I am running it from a shell) dies on save (I
tried file_gif_save  file_bmp_save. Both fail. What am I doing wrong?
What's a good place to find a tutorial that's directed specifically at
stand-alone perl-server applications?

Thanks for the help!
Kate


Here is my sample script:

#!/usr/bin/perl
use Gimp qw(:auto );
use strict;

Gimp::set_trace(TRACE_ALL);
sub do_stuff{
   my $size = '100x100';
   my $color = #00;
   my $img = gimp_image_new($size, $size, RGB);
   my $layer = gimp_layer_new($img, $size, $size, RGB,
Layer 1, 100, NORMAL_MODE);
   gimp_image_add_layer($img, $layer, -1);
   gimp_palette_set_background($color);
   my $out = 'out.gif';
#  file_gif_save(RUN_NONINTERACTIVE, $img, $layer, $out, $out, 0, 0, 0, 0);
   file_bmp_save(RUN_NONINTERACTIVE, $img, $layer, $out, $out);
}


Gimp::on_net(\do_stuff);
exit main();

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Newbie with a Question

2007-05-04 Thread Dub Yah
I just started using Gimp and I LOVE it!  I am
planning on picking up a USB tablet with mouse-pen and
wondered if I should expect any of them to interface
without significant work?

I dont want to spend too much as this is all
relatively new for me, but I want to be able to use
the pen to draw/edit/etc.

Any particular ones that work best or some that dont
work at all with Gimp?

Or am I a total noob and not worth the time it took
you to read this email?

Thanks!

Sean

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Newbie with a Question

2007-05-04 Thread John R. Culleton
On Friday 04 May 2007 13:05, Dub Yah wrote:
 I just started using Gimp and I LOVE it!  I am
 planning on picking up a USB tablet with mouse-pen and
 wondered if I should expect any of them to interface
 without significant work?

 I dont want to spend too much as this is all
 relatively new for me, but I want to be able to use
 the pen to draw/edit/etc.

 Any particular ones that work best or some that dont
 work at all with Gimp?

 Or am I a total noob and not worth the time it took
 you to read this email?


Always glad to help.  Someone will pick up on this conversation and 
answer.

It would help if you mentioned the operating system you are using, 
Windows, MAC OS, Linux etc. 

Also, what version of Gimp are you using?
-- 
John Culleton
Able Indexing and Typesetting
Precision typesetting (tm) at reasonable cost.
Satisfaction guaranteed. 
http://wexfordpress.com

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user