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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 4,332
» Latest member: jpaul
» Forum threads: 6,648
» Forum posts: 36,225

Full Statistics

Latest Threads
exr manipulation
Forum: General questions
Last Post: rich2005
3 hours ago
» Replies: 5
» Views: 124
Color change
Forum: General questions
Last Post: denzjos
3 hours ago
» Replies: 1
» Views: 67
GIMP not utilizing NVIDIA...
Forum: Linux and other Unixen
Last Post: rich2005
4 hours ago
» Replies: 8
» Views: 163
Text tool
Forum: General questions
Last Post: Ofnuts
7 hours ago
» Replies: 3
» Views: 100
Gimp 2.10.36: Menu - View...
Forum: General questions
Last Post: nbeaudet
Yesterday, 09:37 AM
» Replies: 5
» Views: 185
Downloaded the full gimps...
Forum: Watercooler
Last Post: denzjos
Yesterday, 06:46 AM
» Replies: 1
» Views: 81
'plug-in-resynthesizer' n...
Forum: OSX
Last Post: Timbre
04-21-2024, 11:53 PM
» Replies: 3
» Views: 2,220
Gimp reverting document s...
Forum: General questions
Last Post: TimzPilot
04-21-2024, 11:26 PM
» Replies: 2
» Views: 227
Best way to select area b...
Forum: General questions
Last Post: T-buch
04-21-2024, 09:52 AM
» Replies: 2
» Views: 132
How to edit existing path...
Forum: General questions
Last Post: Ofnuts
04-21-2024, 07:12 AM
» Replies: 3
» Views: 115

 
  Comedt shorts
Posted by: PixLab - 10-27-2022, 03:11 AM - Forum: Watercooler - Replies (8)

Just to share  Big Grin



Print this item

  Automate adding text into a PNG
Posted by: Joe_Wulf - 10-27-2022, 02:15 AM - Forum: Older Gimp versions (2.8, 2.6....) - Replies (4)

Hello,

I've been tasked to take over a linux-based project.  In that there are two PNG images, and their (source?) XCF files.  Available GIMP version on linux host is 2.08.
There is specific text that must be replaced into these PNG images as the development works towards the next version of the whole project.
Historically the PNG modifications have been done manually.  I'm looking to automate the task, and preferably with BASH (but I can make adjustments).
I have lots of linux SysAdmin, installation, automation and troubleshooting experience.  Until this project I haven't ever used GIMP; I've simply absorbed the existing task.

The process today is to manually copy "PNG1_20220814.xcf" to "PNG1_20221026.xcf" and copy "PNG2_20220814.xcf" to "PNG2_20221026.xcf".
Next I run "gimp PNG1_20221026.xcf"; and manually edit an existing text box (I then do the same thing with PNG2, but its text is in a different place, though the same content).
I use the TEXT tool (block letter "A"), highlight the date/time text and replace it, then I do the same for the verson number.
I then save the new XCF as is, and then Export the image to the same name as a PNG.  This is done for both images; manually.

PNG1/PNG2 text (standard/normal horizontal text):
         Title Line of what it is (unchanging)
         Date and time of the current version in this format:  "20221026@1922"
         New overall version number, in this format:   "MAJ.min.sml".............. examples: MAJ="218" . min="076" . sml="002"

The 'box' this text is in is transparent, the text is some dark shade of Blue for one, and Red for the other.  All of the text is bolded, and using font "Sans 18 px"

I don't know GIMP well enough to know how to describe digitally WHERE these text boxes are, just that I see them when GIMP opens each one up.


I could easily 'delete' the text box, and save a generic image without it, then use that as the source MASTER image forever.
Next, with a simple bash script, I would easily have the correct date/time stamp and proper version number information automatically available from other parts of the project.
I am seeking assistance in how to automate using GIMP, via Linux, in a strictly scripted fashion to automatically open the MASTER image, insert a new text box with the correct 3 lines of information at the specified coordinates, and then simply export the completed image as a PNG with a newly chosen name (as identified in the copy operation earlier).

I believe with some insight into how to automate inserting a 3 line transparent text box, say 20 pixels down from the top edge and 20 pixels in from the left edge, that I could finangle the process to place the text box in the right location with some iterative testing and logical guesswork.  And as long as the insight is also provide on how to open PNG1, do the right text insert for it, then PNG2 and do the right text insert for it, and could save each PNG.... then I'd be much more efficient.

I have done searches throughout out google and youtube, as well as searches against these forums without finding any answer that matched up to what I'm doing.

Thak you, and I appreciate your help.

R,
-Joe Wulf

Print this item

  CLONE Tool
Posted by: gaystan - 10-26-2022, 07:00 PM - Forum: General questions - Replies (4)

Hi everybody :
   Whenever I try to use the CLONE tool, instead of actually cloning part of an image into another part.
   Instead of cloning part of the picture, I start  "painting" the color in the selected area.
garystan
document.oncontextmenu = null; document.body.onpaste = null; document.body.onselectstart = null; document.onselectstart = null; document.ondragstart = null; document.body.oncut = null; document.onmousedown = null; document.body.oncontextmenu = null; document.body.oncopy = null; document.body.ondragstart = null; document.body.onmousedown = null;

Print this item

  Support
Posted by: gaystan - 10-26-2022, 04:13 AM - Forum: Gimp-Forum.net - Replies (2)

Hi everybody :
 Being the main forum room is permanently closed, how do I get support for
my copy of GIMP.  My version is 2.10.32 revision 1. ?
garystan
document.oncontextmenu = null; document.body.onpaste = null; document.body.onselectstart = null; document.onselectstart = null; document.ondragstart = null; document.body.oncut = null; document.onmousedown = null; document.body.oncontextmenu = null; document.body.oncopy = null; document.body.ondragstart = null; document.body.onmousedown = null;

Print this item

  Gradient 2.10.32
Posted by: Dork Strikes Again - 10-25-2022, 06:59 PM - Forum: General questions - Replies (3)

What are the standard settings for gradient?
I downloaded 2.10.32 and gradient does not work as before.
I cannot lay down multiple radial gradient "bubbles" as I have previously.

Print this item

  Tools remain active when closed or cancelled.
Posted by: memwaa - 10-25-2022, 10:47 AM - Forum: General questions - Replies (2)

Can someone enlighten me or is this normal:
I'm using the latest version of GIMP 2.10.32, however when I use a Tool or Filter, ie Filters:Blur:Focus Blur and subsequently cancel the operation, the tool re-appears when i click on the screen......in other words, the tool remains active in the background until I select another and then that remain active in the background.
Many thanks in anticipation.

Print this item

Wink French is a very difficult language to learn.
Posted by: Krikor - 10-24-2022, 04:44 PM - Forum: Watercooler - Replies (6)

French is a very difficult language to learn.

After making use; without success, of some applications, I decided to try other techniques that would make it easier for me to learn this language.

I tried using music.

The technique would be to watch the video several times until I was able to memorize the lyrics and understand it as if it were in my native language.
But after watching this video countless times https://youtu.be/oX5pLwHbllg I realized that this was not working for me. For some reason I couldn't concentrate on the lyrics (although I think I memorized the choreography).

At the moment I have opted for the videos of the cartoon Caillou. I've almost memorized the opening song.

On NetFlix I have the option to watch movies dubbed in French.
The funny thing is that most French dubbed movies never have French subtitles, and when they do, there is no equivalence between what is heard and what is subtitled.

Not an easy task. I wonder how the French manage to learn this language :-)

Print this item

Python Script "slice using guides" and "png export"
Posted by: Lamidetlm - 10-24-2022, 01:26 PM - Forum: Scripting questions - Replies (6)

Hello everyone, first sorry if my English is average (I'm a stupid French).
As part of a 3d project, I need to develop a small script for gimp. I hope I'm in the right place Smile



I would need a script that follows these steps;
- save the file
- merge all layers
- slice using guides
-export the different images created in .png.as it is all I can do is put the layers together and save each image in Gimp format.

I've scoured the web and tried to combine the scripts found:


Code:
(define (script-fu-save-png Image layer)
  (let* ((i (car (gimp-image-list))) 
         (image))
    (while (> i 0) 
      (set! image (vector-ref (cadr (gimp-image-list)) (- i 1)))
      (gimp-file-save RUN-NONINTERACTIVE 
                      image 
                      (car (gimp-image-merge-visible-layers image 0))                      
                      (car (gimp-image-get-filename image)) 
                      (car (gimp-image-get-filename image))) 
      (gimp-image-clean-all image) 
      (set! i (- i 1))))) 



(script-fu-register
   "script-fu-save-png"
   "<Image>/File/Save PNG & Exit"
   "Save PNG file and exit GIMP."
   "kes"
   "kes"
   "October 2017"
   "RGB*, GRAY*, INDEXED*"
   SF-IMAGE         "Image" 0
   SF-DRAWABLE   "Layer" 0
)

As it is all I can do is put the layers together and save each image in Gimp format.

In the state I do the "slice using guides" me myself. 
Then the script gathers the layers and saves each image in Gimp format.

I can't find the command to do the "slice using guides" nor the modification to switch to png.

Any ideas ?

Thank you for reading me Smile

Print this item

  Python-fu basics: importing and exporting files
Posted by: Xeroxide - 10-24-2022, 04:15 AM - Forum: Scripting questions - Replies (2)

Hi, I am sorry if this is a duplicate question. I did my best to check for topics that answered my question, but I'm still a little lost.

What I am trying to do:
load an image from folder_1,
do some transformation to it (this part I understand well enough),
save the image to folder_2 (I can do this using some code I found)

Where I am getting stuck:
my syntax for loading the file seems to be wrong.
It's not showing up in the file menu, which I assume means that I'm missing some essential lines.

I found some code that works to save the file, so I will omit that from my code sample.

This is basically what I have.



#!/usr/bin/python
from gimpfu import *

def load_file():

    path = "C:\Users\User\Pictures\GIMP\folder_1\01.png"
    filename = path
    raw_filename = path
    image = pdb.file_png_load(filename, raw_filename)


register(
    proc_name = ("python-fu-load"),
    blurb = ("load file"),
    help = ("imports png from 'new folder' with the name 01"),
    author = ("REC"),
    copyright = ("REC"),
    date = ("2022"),
    label = ("load file"),
    imagetypes = ("*"),
    parameters = [
        (PF_IMAGE, "image", "takes current image", None),
        (PF_DRAWABLE, "drawable", "input layer", None)
        ],
    results = [],
    function = (load_file),
    menu = ("<image>/Layer")
    )

main()




I know that I'm missing something very basic, but I haven't been able to find an example that simply loads a file to work on using python-fu.
I would love to get my hands on some basic utility plugins or examples written for python-fu, if I have something to reference I can probably figure out what I need.

Thank you for reading this.

Print this item

  Resize all layers in script-fu
Posted by: BaconWizard17 - 10-23-2022, 04:08 PM - Forum: Scripting questions - Replies (9)

Hi all! I've got a bit of a question about scripting. I'm trying to get a script to resize two both layers of an image instead of just the active one, but I'm not entirely sure how to go about doing that. First, I set up the image with this script:

Code:
(define (script-fu-mua-xml2-single-preview)
    (let*
        (
            (theImageWidth  543)
            (theImageHeight 1080)
            (theImage
                (car
                    (gimp-image-new
                       theImageWidth
                       theImageHeight
                       RGB
                    )
                )
            )
            (backgroundLayer
                (car
                    (gimp-layer-new
                        theImage
                        theImageWidth
                       theImageHeight
                       RGBA-IMAGE
                       "Background"
                       100
                       LAYER-MODE-NORMAL
                    )
                )
            )
            (portraitLayer
                (car
                    (gimp-layer-new
                        theImage
                       theImageWidth
                       theImageHeight
                       RGBA-IMAGE
                       "Portraits"
                       100
                       LAYER-MODE-NORMAL
                    )
                )
            )
        )
        (gimp-image-add-layer theImage backgroundLayer 0)
        (gimp-image-add-layer theImage portraitLayer 0)
        (gimp-image-set-active-layer theImage backgroundLayer)
        (gimp-display-new theImage)
    )
)

I then do some work with that image and export it. After that, I want to double the width of the image by resizing the canvas. In doing so, I want all the layers to resize as well. Here's what I have so far:
Code:
(define (script-fu-mua-xml2-double-preview image layer)
    (gimp-image-undo-group-start image)
    (gimp-selection-none image)
    (gimp-image-resize image 1086 1080 0 0)
    (gimp-layer-resize-to-image-size layer)
    (gimp-displays-flush)
    (gimp-image-undo-group-end image)
)

I cut out some extra stuff from both scripts like some codes to add vertical/horizontal guides in various places which all works the way I want it to. Generally, I have the top layer selected when I execute the second script, so the top layer is resized, but the bottom one isn't. I want it to be able to resize both layers to the image size, though, regardless of which one I have actively selected (if it's possible to do so). How do I go about doing that?

Print this item