Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,622
» Latest member: dishaverma786
» Forum threads: 7,175
» Forum posts: 39,203

Full Statistics

Latest Threads
Multiple install paths in...
Forum: Windows
Last Post: Ofnuts
24 minutes ago
» Replies: 1
» Views: 58
Copy color effect to othe...
Forum: General questions
Last Post: PBog
2 hours ago
» Replies: 6
» Views: 209
Some questions about brus...
Forum: General questions
Last Post: rich2005
6 hours ago
» Replies: 2
» Views: 103
flowery cliff
Forum: Gallery
Last Post: MJ Barmish
Yesterday, 01:29 PM
» Replies: 2
» Views: 107
How can I run Flatpak ver...
Forum: Linux and other Unixen
Last Post: Ofnuts
02-18-2025, 11:27 PM
» Replies: 3
» Views: 138
Export all opened images ...
Forum: Extending the GIMP
Last Post: Krikor
02-18-2025, 09:18 PM
» Replies: 8
» Views: 5,009
Arrow Script
Forum: Extending the GIMP
Last Post: programmer_ceds
02-18-2025, 04:51 PM
» Replies: 122
» Views: 152,027
Turn photo negative to po...
Forum: Tutorials and tips
Last Post: programmer_ceds
02-18-2025, 11:11 AM
» Replies: 4
» Views: 12,114
multiple images on one pa...
Forum: General questions
Last Post: sallyanne
02-17-2025, 11:35 PM
» Replies: 2
» Views: 179
Problème de langage sur l...
Forum: Gimp-Forum.net
Last Post: Bart Simpson
02-17-2025, 07:04 PM
» Replies: 3
» Views: 130

 
  New Here
Posted by: Danielsan - 03-14-2017, 12:17 AM - Forum: Gimp-Forum.net - Replies (2)

Hi All,

I didn't know the older forum was closed so after reading the Pat David's blog I ran here to register myself, however I didn't get this part of your terms:

Quote:The admins do their best to keep this forum fit for all ages, but, due to their European culture, they can come across as rather laid-back on some subjects and tight-fisted on others


I am Italian... So what does it mean?

Probably in the intention of the person who wrote this sentence was to use an ironic tone but honestly it seems quite discriminatory in several ways.

I suggest you to review the tone of this sentence because it is totally against yours final statement:


Quote:We try to manage this forum as sensible adults, we expect members to be the same.

Regards,

D.

Print this item

  Debugging python-fu scripts in Windows
Posted by: Ofnuts - 03-13-2017, 10:42 AM - Forum: Tutorials and tips - Replies (1)

Debugging python-fu scripts

As Brian Kernighan wrote, "The most effective debugging tool is still careful thought, coupled with judiciously placed print statements.".

On Linux (and likely OSX) things are easy: if you start Gimp from a terminal, all the output from print statements in Python plugins will be displayed in the terminal.

But on Windows, the output of plain print statements cannot be seen, so you have two options:

Using gimp_message()

This is a simple method which is OK to diagnose small and local problems, but it is better used on code which is known to be mostly working.

  • start the Error console dialog
  • use gimp_message() instead of print (if the Error console dialog is not up, Gimp stops with a dialog for each use of gimp_message())

Running your script in the python-fu console

This method is a bit more complex, but all the output is visible, even from parts of Python that you don't control (error messages, etc...)

We just have to overcome a few hurdles, namely:
  • by default Python doesn't look in the directory where your code is
  • the registration code doesn't work in the python-fu console, if fact it makes it crash.
  • taking the new version in account with minimal effort after editing the code

So, assuming you are working on plugin.py, with an entry point (the function you point to in the register() call) named execPlugin that takes an image and a layer, and that the file is in the plug-ins directory of your profile:
  • while testing the function, comment out the register() and main() call in your python
  • make sure your file name is a valid python identifier (no dashes in the name, for instance)
  • start the python-fu console, make sure you have one single image loaded and enter:
Code:
import sys;

# extend the python path to include the plug-ins directory
sys.path=[gimp.directory+'/plug-ins']+sys.path

#import the plugin
import plugin
  • to run the function:
Code:
# retrieve the image (if you have several images, it will be a bit more complicated)
# here we bluntly retrieve the first image in the list of loaded images  
image=gimp.image_list()[0]

# Call the function: note that the function name is prefixed with the module name
plugin.execPlugin(image,image.active_layer)
  • if you edit the file, to reload the new version of the code:
Code:
reload(plugin)
  • if your plugin function takes more parameters you have to provide them "manually". In most cases they will just be strings (text, but also file names, fonts, brushes,...) or numbers. The semi-difficult cases are layers and other images, because the parameter is an object, so you have to retrieve it with python code (obtain the other image in gimp.image_list(), for instance, or a drawable from image.layers and checking its name).
  • to start afresh, just close and reopen the python console
  • when done, don't forget to:
    • uncomment the registration code
    • remove the print statements... in Windows they can freeze your script if the total length of output is bigger than 4KB (because there is nothing to read it)

Routing python outputs to file

(this method inspired by a post by SeldomNeedy on the Gimp user mailing list)

This is a rather simple method, which is best used with an editor clever enough to reload the file when it notices changes. With this method, everything Python would write on the console (print statements, error messages... ) goes to a file, that you can check with a text editor. At the beginning of the file, do:
Code:
import sys
sys.stderr = open('C:/temp/python-fu-output.txt','a')
sys.stdout=sys.stderr # So that they both go to the same file

Other locations are possible:
Code:
sys.stderr = open(gimp.directory+'/../My Documents/python-fu-output.txt','a')

(contrary to popular belief, forward slashes are usable as path separators on Windows, only the command prompt parser doesn't like them).

When you are done with debugging, you can disable all the tracing by simply replacing the initial file opening.
Code:
Code:
import os
sys.stderr = open(os.path.devnull,'a')

os.path.devnull is the right "bit bucket" for the platform the code is running on, so this makes your plugin compatible with Windows, Linux, and OSX.

Print this item

  Cropping images - pasting to new layer - layer boundary size
Posted by: peterpil19 - 03-13-2017, 05:48 AM - Forum: General questions - Replies (5)

Hi,

First post on this forum.

I enjoy using GIMP.

I have a question about cropping and pasting as new layer.

When cropping a select part of an image using the fuzzy select tool and pasting it into a new layer, the layer boundary exceeds the cropped image size  - there is typically extra vertical space around the top and bottom of the cropped image.

This makes resizing particularly difficult because I cannot compare the actual size of the cropped image to that of other layers pasted into the image because of the extra space.

I can confirm that nothing else has been selected below the cropped image.

I use GIMP to crop photos of coins.
So I crop and paste side A of the coin.
I then crop and paste side B as a new layer. However GIMP adds extra space  around the image which makes resizing side B really hard. It would otherwise be as simple as resizing the layer/image of side B to match side A.

Any help would be appreciated as have not been able to work out why this is happening.

Peter

Print this item

  Hello, found you
Posted by: carl7 - 03-12-2017, 09:03 PM - Forum: General questions - Replies (5)

I used to be a  member (knotty) of the 'OLD' forum that went under. Wondered what happened! anyway a question. I'm inbetween Internet connections. So wondering if I can download the latest GIMP at a public computer (library) onto a flashdrive and then install it to my home computer?

Thanks! Carl

Print this item

  How to make playback image larger
Posted by: Gaunt - 03-12-2017, 05:38 PM - Forum: General questions - Replies (1)

Hi! I'm a gimp newbie so sorry if this was already answered. I've been trying to animate pixel art on a 64 x 64 pixel canvas. My issue is that when I try and playback the animation it is really small. Is there a way of making playback larger or is the only solution to draw with more pixels?

Print this item

  Hello!!
Posted by: Luixx - 03-12-2017, 04:27 PM - Forum: General questions - Replies (1)

My name is Luigi,


I'm studying GIMP and English to learn better GIMP.

From italy,

Google Translate.

Thanks.

Print this item

  Simple tools for animations.
Posted by: rich2005 - 03-12-2017, 11:27 AM - Forum: Extending the GIMP - No Replies

I am a great believer in using the basic Gimp tools wherever possible, some easy to use 'effects' scripts quickly produce a result, but getting the same 'result' as everyone else, is not very creative.

However, sometimes scripts and plugins are a boost to productivity, especially when it comes to animations and the many-many layers that are involved. If you are really into animation then go for the old Gimp Animation Plugin/Package GAP. 

I do not really want that monster cluttering up my installation just for the very occasional animation project, so here are some scripts and plugins used in the demo video that might come in useful.

This one follow-path.py might only be needed once-in-a-while but it does save a lot of manual work. There are others that do similar.

http://www.arakne.es/en/2014/04/ 
http://www.arakne.es/wp-content/uploads/...-path5.zip

Saul Goodes page.
http://chiselapp.com/user/saulgoode/repo...pt-fu/home 

Worth bookmarking, lots of useful scripts including one to manage layer-groups. You can do it by hand but for more that a few layers, it becomes very tedious.
http://chiselapp.com/user/saulgoode/repo...roup-layer

Ofnuts plugins. 
http://sourceforge.net/projects/gimp-too...s/scripts/

If you need to merge two animations or add text then interleave-layers-0.4.py is very straight forward. 
Duplicating layers, various ways by hand but ofn-reorder-copy-layers.py speeds the process up.

Finally a little tool, does not do very much, I use it mainly for dumping layers to single png's with sensible numbered names. Nice simple plugin for renaming layers, anitools.py http://registry.gimp.org/node/25029

All of those in action.




Print this item

  Black turns into dark green after mode change.
Posted by: Harris - 03-11-2017, 12:52 PM - Forum: General questions - Replies (2)

Good day! I am new to this community and would like to ask something.

I am making an image which contains a glowing symbol in the middle. The black parts are seen as transparent for the engine I am going to load it. That's why I want the values from the black areas to remain at zero after switching from RGB to indexed ( 256 ) mode. Instead black becomes a dark green color.

However when I try this with a plain black image it remains black, so my guess is that the whole picture is affected by the glowing thing I made in the middle. How can I prevent this from happening? I am using GIMP 2.8.16 if that matters.

Print this item

  New Install Program in Pieces
Posted by: TooLoose - 03-10-2017, 03:05 PM - Forum: Windows - Replies (2)

I just installed Gimp and the program opens in three separate disconnected pieces, the main screen and two palettes, toolbox and brushes.  I will attach a screenshot.  I can't dock the palettes onto the main program.

How do I connect it?



Attached Files Thumbnail(s)
   
Print this item

  The Earth revolves around Gimp
Posted by: rich2005 - 03-09-2017, 08:15 PM - Forum: Other graphics software - Replies (2)

I was thinking about Seano's post where he is making an animation of the moon rotating around the earth. Lots and lots of layers for Gimp.

Art Of Illusion is a well established java application for ray-tracing/3D rendering and can output all the frames required for an animation. 

   

Too many / too large for a gif so here is a couple of orbits in a video.



Print this item