From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Alexander Bokovoy To: mandrake-russian@altlinux.ru Message-ID: <20020312104718.GE4293@sam-solutions.net> Mail-Followup-To: mandrake-russian@altlinux.ru References: <18515597998.20020311122236@erec.ru> <1179423590.20020311124021@mail.ru> <20020311124359.5c7385e5.kosha@kp.ru> <10310182091.20020311125300@mail.ru> <20020311125731.79a1e194.kosha@kp.ru> <4118285583.20020311150803@mail.ru> <20020311151105.03cbca94.kosha@kp.ru> <2119373647.20020311152611@mail.ru> <20020311220514.GH3137@mhz.mikhail.zabaluev.name> <40500764260.20020312110448@talarii.co.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <40500764260.20020312110448@talarii.co.ru> Subject: [mdk-re] Re: [JT] =?koi8-r?B?y8/O08/M2M7Zyg==?= gimp Sender: mandrake-russian-admin@altlinux.ru Errors-To: mandrake-russian-admin@altlinux.ru X-BeenThere: mandrake-russian@altlinux.ru X-Mailman-Version: 2.0 Precedence: bulk Reply-To: mandrake-russian@altlinux.ru List-Help: List-Post: List-Subscribe: , List-Id: Linux-Mandrake RE / ALT Linux discussion list List-Unsubscribe: , List-Archive: Date: Tue Mar 12 13:47:25 2002 X-Original-Date: Tue, 12 Mar 2002 12:47:18 +0200 Archived-At: List-Archive: List-Post: On Tue, Mar 12, 2002 at 11:04:48AM +0300, Artem Pastuchov wrote: > Hello Mikhail, > > Tuesday, March 12, 2002, 1:05:14 AM, you wrote: > > MZ> Hello roman_tutov, > > MZ> On Mon, Mar 11, 2002 at 03:26:11PM +0300, roman_tutov@mail.ru wrote: > >> > >> ЗЫ . Да ну вас линуксоидов . Я удивляюсь почему гимп не консольный .:) > > MZ> Ну, а чем плох ImageMagick? :) > Мало того , никто не мешает применятьGimp в консоли > для этого есть перловые и питоновые модули И модули для Ruby. Которые, более того, позволяют действительно в консоли все проделывать, да еще и из программы, запущенной на другой машине. Вот пример (взят из рассылки ruby-talk, автор Masahiro Sakai): 1. start up gimp and dRuby server (its menu path is /Xtns/Ruby-Fu/dRuby Server/Start...) BTW you can start up them from command-line like % gimp --no-interface --batch '(ruby-fu-druby-server 1 "druby://:7950" "")' 2. Then you can use gimp procedures via dRuby. Following is an example. require 'gimp/base' require 'drb/drb' DRb.start_service(nil, nil) g = DRbObject.new(nil, 'druby://:7950') width = 100 height = 100 old_fg = g.gimp_palette_get_foreground old_bg = g.gimp_palette_get_background img = g.gimp_image_new(width, height, Gimp::RGB) begin img.undo_disable # equivalent to g.gimp_image_undo_disable(img) d = g.gimp_layer_new(img, width, height, Gimp::RGBA_IMAGE, "Background", 100, Gimp::NORMAL_MODE) img.add_layer(d, -1) # equivalent to g.gimp_image_add_layer(img, d, -1) g.gimp_palette_set_background(Gimp::Color.new(255,255,255)) g.gimp_edit_fill(d, Gimp::BG_IMAGE_FILL) d = g.gimp_layer_new(img, width, height, Gimp::RGBA_IMAGE, "BoxLayer", 100, Gimp::NORMAL_MODE) img.add_layer(d, -1) g.gimp_drawable_fill(d, Gimp::TRANS_IMAGE_FILL) g.gimp_rect_select(img, width/4, height/4, width/2, height/2, Gimp::ADD, false, 0) g.gimp_palette_set_foreground(Gimp::Color.new(0,0,255)) g.gimp_bucket_fill(d, Gimp::FG_BUCKET_FILL, Gimp::NORMAL_MODE, 100, 0, false, 0, 0) g.gimp_selection_none(img) #g.script_fu_drop_shadow(Gimp::RUN_NONINTERACTIVE, img, d, "8", "8", "5.0", # Gimp::Color.new(0,0,0), "70", true) img.active_layer = d g.gimp_palette_set_foreground(Gimp::Color.new(255, 0, 0)) d = g.gimp_text_fontname(img, nil, width/4, height/4, "Ruby!", 0, true, 15, Gimp::PIXELS, "-adobe-utopia-medium-r-normal-*-*-*-*-*-p-*-*") img.flatten # equivalent to g.gimp_image_flatten(img) filename = '/home/susho/my_src/hoge.bmp' g.file_bmp_save(Gimp::RUN_NONINTERACTIVE, img, img.active_drawable, filename, filename) ensure img.delete # equivalent to g.gimp_image_delete(img) g.gimp_palette_set_background(old_bg) g.gimp_palette_set_foreground(old_fg) end There are many many proedures provided by the gimp. DB Browser (Xtns/DB Browser...) will be your help for searching functions. -- / Alexander Bokovoy Software architect and analyst // SaM-Solutions Ltd. --- I'm having an emotional outburst!!