gimp

GIMP difference of Gaussians in Opencv

牧云@^-^@ 提交于 2019-12-24 13:02:25
问题 I want to replicate the GIMP Filter > Edge Decect > Difference of Gaussians in C++ using opencv. I found this simple code for DOG implementation bu I want the same result of GIMP with the two params Raidus1 and Radius2. Mat g1, g2, result; Mat img = imread("test.png", CV_LOAD_IMAGE_COLOR); GaussianBlur(img, g1, Size(1,1), 0); GaussianBlur(img, g2, Size(3,3), 0); result = g1 - g2; How can add the 2 radius params to the implementation? Sample input image Params Output If can help this is the

Resize image by percentage on both x and y on command line with Gimp

社会主义新天地 提交于 2019-12-24 00:45:16
问题 AFAIK, it should be possible. I know that convert of ImageMagick makes this task trivial, but I cannot use ImageMagick, therefore I am leaning towards Gimp (on Windows). I have tried with this Guile script: (define (resize-image filename new-filename scale) (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) (drawable (car (gimp-image-get-active-layer image))) (width (gimp-image-width image)) (height (gimp-image-height image))) (gimp-image-scale-full image (* width

Measure “ink” of a plot

情到浓时终转凉″ 提交于 2019-12-23 09:04:53
问题 I am reading on Tufte's data-ink ratio and I was wondering if it is possible to measure the amount of "ink" a plot uses? If not possible in R perhaps with another tool such as GIMP or imagemagick? 回答1: I'd suggest using grid.cap() to convert the contents of the graphics device to a raster, after which it's a simple matter to compute the proportion of non-white pixels (aka "ink"). In the following example, to focus the computations on ink in the plotting area, I've set par(mar=c(0,0,0,0)) ,

How do I output info to the console in a Gimp python script?

孤街醉人 提交于 2019-12-21 09:31:45
问题 I've just started learning about Gimp scripting using Python, and was wondering, how do I output text to the console? I am using version 2.7.5 on Windows 7. I tried the print function, but it does not write anything to the python-fu console or the dev console that launches with Gimp. Is there a function I should use to do this? or is this a problem with the 2.7.5 release? I found a few mentions of "gimp-message" but that seems to be a function used with Scheme (Script-fu) Thanks! (also posted

How do I output info to the console in a Gimp python script?

断了今生、忘了曾经 提交于 2019-12-21 09:30:14
问题 I've just started learning about Gimp scripting using Python, and was wondering, how do I output text to the console? I am using version 2.7.5 on Windows 7. I tried the print function, but it does not write anything to the python-fu console or the dev console that launches with Gimp. Is there a function I should use to do this? or is this a problem with the 2.7.5 release? I found a few mentions of "gimp-message" but that seems to be a function used with Scheme (Script-fu) Thanks! (also posted

How do I convert images (PSD, AI and EPS) to PDF?

℡╲_俬逩灬. 提交于 2019-12-21 05:37:17
问题 Customers of my Django site can upload a print design in: PDF, PSD, AI and EPS. If the filetype they upload is not PDF I want to convert it to PDF. So my question is: How do I convert Photoshop, Illustrator and CorelDraw files to PDF (programmatically)? I tried UniConvertor but it: does not support PSD, distorted my AI inputs, and rejected my EPS inputs. Know any workarounds? I am open to running separate scripts for each filetype. I googled "psd to pdf" but the results all looked like spam.

How do I save (export) all layers with gimp's script fu?

醉酒当歌 提交于 2019-12-20 20:00:56
问题 With gimp fu, I can save the content of one layer (at least, that is how I interprete the definition of gimp_file_save because it takes the parameter drawable ). Now, I have the following script: from gimpfu import * def write_text(): width = 400 height = 100 img = gimp.Image(width, height, RGB) img.disable_undo() gimp.set_foreground( (255, 100, 20) ) gimp.set_background( ( 0, 15, 40) ) background_layer = gimp.Layer( img, 'Background', width, height, RGB_IMAGE, 100, NORMAL_MODE) img.add_layer

Writing gimp plugins in python on windows- how do i debug? where is the output?

↘锁芯ラ 提交于 2019-12-20 09:53:17
问题 EDITED HEAVILY with some new information (and a bounty) I am trying to create a plug in in python for gimp. (on windows) this page http://gimpbook.com/scripting/notes.html suggests running it from the shell, or looking at ~/.xsession-errors neither work. I am able to run it from the cmd shell, as gimp-2.8.exe -c --verbose ## (as suggested by http://gimpchat.com/viewtopic.php?f=9&t=751 ) this causes the output from "pdb.gimp_message(...)" to go to a terminal. BUT !!! this only works when

How do I use Gimp / OpenCV Color to separate images into coloured RGB layers?

女生的网名这么多〃 提交于 2019-12-13 19:15:44
问题 I have a JPG image, and I would like to find a way to: Decompose the image into red, green and blue intensity layers (8 bit per channel). Colorise each of these now 'grayscale' images with its appropriate color Produce 3 output images in appropriate color, of each channel. For example if I have an image: dog.jpg I want to produce: dog_blue.jpg dog_red.jpg and dog_green.jpg I do not want grayscale images for each channel. I want each image to be represented by its correct color. I have managed

How to use gimp_drawable_set_pixel()?

好久不见. 提交于 2019-12-13 17:25:50
问题 I could like to set a pixel in GIMP, but I can't figure out how to specify the pixel value. According to the GIMP plugin API it says: gboolean gimp_drawable_set_pixel (gint32 drawable_ID, gint x_coord, gint y_coord, gint num_channels, const guint8 *pixel); If I e.g. do: const guint8 *pixel; pixel = (guint8 *) 0; gboolean s; s = gimp_drawable_set_pixel (layer, 5, 5, 3, pixel); printf ("Was the pixel set?: %i", s); The pixel is not set, and s is zero. Can anyone figure this one out? Lots of