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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 4,619
» Latest member: Jānis
» Forum threads: 7,481
» Forum posts: 40,854

Full Statistics

Latest Threads
CMYK color mode Gimp 2.10
Forum: Extending the GIMP
Last Post: rich2005
4 hours ago
» Replies: 18
» Views: 81,664
how to change default pas...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: CmykStudent
5 hours ago
» Replies: 23
» Views: 11,894
Endianess of pixel data i...
Forum: Scripting questions
Last Post: Ofnuts
5 hours ago
» Replies: 3
» Views: 67
Color is not translating ...
Forum: General questions
Last Post: Mfrench4712
9 hours ago
» Replies: 0
» Views: 40
Edge detect leaves invisi...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: marty39
Yesterday, 12:18 PM
» Replies: 3
» Views: 131
cannot find instructions ...
Forum: General questions
Last Post: rich2005
Yesterday, 09:19 AM
» Replies: 4
» Views: 153
3.0.4 crashes all the tim...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: mayorpunk
07-13-2025, 11:13 PM
» Replies: 0
» Views: 44
Warped text
Forum: General questions
Last Post: Tas_mania
07-13-2025, 11:20 AM
» Replies: 2
» Views: 210
GEGL Plugins for GIMP 3.0...
Forum: Extending the GIMP
Last Post: BeaverGEGLFreak
07-13-2025, 10:42 AM
» Replies: 1
» Views: 264
Blur/Sharp tool
Forum: General questions
Last Post: AWysy
07-13-2025, 08:05 AM
» Replies: 5
» Views: 333

 
  GIMP 2.9.8 Script slice and dice plz Help : unbound variable REPLACE
Posted by: the_papy - 12-17-2017, 12:30 PM - Forum: General questions - Replies (6)

¨plz Help
here the code:

but ERROR : eval: unbound variable REPLACE

:-( , in gimp 2.8 its work , no with gimp 2.9.8 :-(

Code:
; Studio Tecnico Arch. Giuseppe Conte  
; via Roma, 28
; 72026 - San Pancrazio Salentino (BR) - Italy
;
; Plugin  : slice-and-join.scm
; Author  : Arch. Giuseppe Conte
; Update  : Single Tech Games, Anonymous & Teseracto
; Date    : 03 marzo 2009 - San Pancrazio Salentino (BR)
; Revision: 23 mayo 2012
;
; Version : 1.1
; Last version at: http://xoomer.virgilio.it/lwcon/gimp/
; Help guide at  : http://xoomer.virgilio.it/lwcon/gimp/scripts/image-slice-and-join.htm
;
; Description:
; Slice: subdivide the active image in M x N Rows and Columns and save any rectangular portion in the new files.
;                Slice save into file *.rcm all the data necessary in order to reconstruct the image
; Join: read data from *.rcm file and reconstructs an image subdivided with image-slice script-fu.
;
; File *.rcm: is structured in rows
;                sample:
;                row 1 : "ATGrcm"
;                row 2 : imageWidth
;                row 3 : imageHeight
;                row 4 : number cols
;                row 5 : number rows
;                row 6 : filename portion 1,1
;                row 7 : filename portion 1,2
;                row 8 : filename portion 2,1
;                row 9 : filename portion 2,2
;                row 10: ........  
;
; -----------------------------------------------------------------------------
;
; License:
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
; -----------------------------------------------------------------------------
;
; Define the function:

(define (script-fu-image-slice inImage inLayer nRighe nColonne option dataDir)

    (let* (    (orFilename (car (gimp-image-get-filename inImage)))
                    (orWidth (car (gimp-image-width inImage)))
                    (orHeight (car (gimp-image-height inImage)))
                    (newW (/ orWidth nColonne))
                    (newH (/ orHeight nRighe))
                    (name-length 0)
                    (inizio 0)
                    (extension "")
                    (type 0)
                    (contaR 0)
                    (contaC 0)
                    (inXorig 0)
                    (inYorig 0)
                    (inWidth 0)
                    (inHeight 0)
                    (cnt 0)
                    (filename "")
                    (newimage 0)
                    (newlayer 0)
                    (activelayer 0)
                    (floating-sel 0)  
                    (colonna "")
                    (riga "")
                    (post "")
                    (joinsaveFile "")
                    (nf 0)
                    (rcmFile "")
                    (filenamex "")
                    (contador "")
                )


    ;; salva il file origine se non è stato salvato
    ;; imposta il nome del file per il salvataggio dei dati
    ;; imposta il nome del file per il salvatggio dei vari pezzi

    (if (= (string-length orFilename) 0)
        (begin
            (set! orFilename "image.xcf")
            (gimp-file-save 1 inImage inLayer orFilename orFilename)
            (set! rcmFile (string-append dataDir "\\" orFilename ".rcm"))
            (set! filename (string-append dataDir "\\" orFilename ))
        );end begin

        (begin
            (set! rcmFile (string-append dataDir "\\" (solonomefile orFilename) ".rcm"))
            (set! filename (string-append dataDir "\\" (solonomefile orFilename) ))
        );end begin
    );end if
    

;;determina l'estensione del file origine
    (set! name-length (string-length orFilename))
    (set! inizio (- name-length 4))
    (set! extension (substring orFilename inizio name-length))

;;fine estensione file
    
;;leggo le dimensioni dell'immagine
    (set! inHeight (car (gimp-image-height inImage)))
    (set! inWidth (car (gimp-image-width inImage)))

;;apro il file per la scrittura delle informazioni di recupero
     (set! nf (open-output-file rcmFile))
     ;scrittura signature, dimensioni immagine numero di righe e colonne
     (write "ATGrcm" nf)
     (newline nf)
     (write inWidth nf)
     (newline nf)
     (write inHeight nf)
     (newline nf)
     ;(write inWidth nf)
     ;(newline nf)    
     (write nColonne nf)
     (newline nf)
     (write nRighe nf)


;;fine scrittura dati

;imposta l'estensione se il file deve essere salvato in un altro formato

(cond
    ( (= option 1)    (set! extension ".png"))
    ( (= option 2)    (set! extension ".jpg"))
    ( (= option 3)    (set! extension ".bmp"))
    ( (= option 4)    (set! extension ".tif"))
    ( (= option 5)    (set! extension ".xcf"))        
)

;determina il tipo di immagine (RGB, GRAY, INDEXED)
(set! type (car (gimp-image-base-type inImage)))
      
;;imposto il ciclo per la suddivisione dell'immagine
(set! contaR 1)
(set! contaC 1)
(set! inXorig 0)
(set! inYorig 0)
(set! inWidth newW)
(set! inHeight newH)
(set! cnt 1)

;;imposta percorso e nome file per il salvataggio ******-> Disattivo la linea seguente
;(set! filename (car (gimp-image-get-filename inImage)))
      
(while ( <= contaR nRighe)
    
    (set! inWidth newW)
    (set! inHeight newH)
    
    (while ( <= contaC nColonne)
        
;seleziona e copia una porzione dell'immagine
         (gimp-rect-select inImage inXorig inYorig inWidth inHeight REPLACE FALSE 0)
         (gimp-edit-copy inLayer)

;imposta la nuova immagine ed incolla la selezione
        (set! newimage (car (gimp-image-new inWidth inHeight type)))
        (set! newlayer (car (gimp-layer-new newimage  inWidth inHeight type "Sfondo" 0 NORMAL)))
   (gimp-image-add-layer newimage newlayer 0)
   (gimp-drawable-fill newlayer BG-IMAGE-FILL)(gimp-layer-add-alpha newlayer) (gimp-edit-clear newlayer)
        (set! activelayer (car (gimp-image-set-active-layer newimage newlayer)))
        (set! floating-sel (car (gimp-edit-paste newlayer FALSE)))
     (gimp-floating-sel-anchor floating-sel)

;;imposta ed assegna un nome al nuovo file (nomefile-riga-colonna)
      ;(set! filename (car (gimp-image-get-filename inImage)))
      (set! contador (number->string cnt))
      (set! cnt (+ cnt 1))
      ;(set! colonna (number->string contaC))
      ;(set! riga (number->string contaR))
      (set! post "")
      ;(set! post (string-append riga colonna contador))
      (set! post (string-append contador))
      (set! filename (filename-basename filename))

      (set! filenamex (string-append filename post extension))

      (gimp-image-set-filename newimage filenamex)      
      (gimp-file-save 1 newimage newlayer filenamex filenamex)

     ;salva il nome del file sul file *.rcm
     (newline nf)
     (write (solonomefile filenamex) nf)

    (set! inXorig (+ inXorig newW))  ;origine x rettanglo di selezione
    (set! contaC (+ contaC 1))

    );end while col
    
    (set! contaC 1)
    (set! inYorig (+ inYorig newH))
    (set! inXorig 0)
    (set! contaR (+ contaR 1))
    
);end while row

    (close-output-port nf)
 (gimp-displays-flush)
 (gimp-selection-none inImage)
 
 );let
);def

(script-fu-register
"script-fu-image-slice"
_"<Toolbox>/Xtns/ATG/Image slice"
"Slice the image in MxN Rows and Columns and save any rectangular portion in the new files."
"Arch. Giuseppe Conte"
"2009, Conte Giuseppe"
"20 marzo, 2009 - Ver. 1.0"
"RGB* GRAY* INDEXED*"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-ADJUSTMENT "Rows   " '(3 0 99999999 1 10 0 1)
SF-ADJUSTMENT "Columns" '(3 0 99999999 1 10 0 1)
SF-OPTION "Save as" '("Default" ".png" ".jpg" ".bmp" ".tif" ".xcf")
SF-DIRNAME "Salva in " (string-append "" gimp-data-dir "/" )
 
)

;;Single tech games: this function cuts the extension from the filename, esta funcion corta la extension del nombre de archivo
(define (filename-basename filename)
(car (strbreakup filename ".")))

;;;
;;; Join Image

;;funzioni di servizio
;;; Estrae il solo percorso
;;; funziona




(define (solopath x)
    (let* ( (cnt 0)
                    (lung 0)
                    (fine 0)
                )
    (set! lung (string-length x))
    (while (< cnt lung)
                (if (equal? (substring x cnt (+ cnt 1)) "\\") (set! fine cnt) )
                (set! cnt (+ cnt 1))
    );while
    ;(gimp-message (number->string fine))
    (substring x 0 (+ fine 1))
    
    );let

);def


(define (solonomefile x)
    (let* ( (cnt 0)
                    (lung 0)
                    (fine 0)
                )
    (set! lung (string-length x))
    (while (< cnt lung)
                (if (equal? (substring x cnt (+ cnt 1)) "\\") (set! fine cnt) )
                (set! cnt (+ cnt 1))
    );while
    ;(gimp-message (number->string fine))
    (substring x (+ fine 1) lung)
    
    );let

);def


;;fine funzioni di servizio

(define (script-fu-image-join joinFile)
    (let* (    (signature "ATGrcm")
                    (imageHeight 0)
                    (imageWidth 0)
                    (nRows 0)
                    (nCols 0)
                    (tearFile "")
                    (openFile "")
                    (lettura "")
                    (imageID 0)
                    (newlayer 0)
                    (activelayer 0)
                    (cntRow 1)
                    (cntCol 1)
                    (tempFilename "")
                    (activePath "")
                    (rawFilename "")
                    (addlayer 0)
                    (startx 0)
                    (starty 0)
                    (layerWidth 0)
                    (layerHeight 0)
                )

        ;(gimp-message joinFile)
        (set! activePath (solopath joinFile))
        ;(gimp-message activePath)
        
        (set! openFile (open-input-file joinFile ))
        (set! lettura (read openFile))
        
        (cond
            (    (equal? signature lettura )
                (set! lettura (read openFile))
                (set! imageWidth lettura)
                (set! lettura (read openFile))
                (set! imageHeight lettura)
                (set! imageID (car (gimp-image-new imageWidth imageHeight 0)))
                (set! newlayer (car (gimp-layer-new imageID  imageWidth imageHeight 1 "Sfondo" 1 0)))
           (gimp-image-add-layer imageID newlayer 0)
                (set! activelayer (car (gimp-image-set-active-layer imageID newlayer)))
         
         (gimp-display-new imageID)
         (gimp-displays-flush)
         
         ;apro le immagini una ad una, leggo le dimensioni le copio e le incollo
         
         ;leggo il numero di righe e di colonne
         (set! nCols (read openFile))
         (set! nRows (read openFile))
         (set! cntRow 0)
         (set! cntCol 0)
         
         (while (< cntRow nRows)
         
             (while (< cntCol nCols)
                 (set! tempFilename (read openFile))
                 (set! rawFilename (string-append activePath tempFilename))
                 ;apro l'immagine e l'aggiungo come layer
                 (set! addlayer (car (gimp-file-load-layer 1 imageID rawFilename)))
                 (gimp-image-add-layer imageID addlayer -1)
                 (gimp-layer-translate addlayer startx starty)
                 (set! layerHeight (car (gimp-drawable-height addlayer)))
                 (set! layerWidth (car (gimp-drawable-width addlayer)))
                 (set! startx (+ startx layerWidth))
                 
                 (set! cntCol (+ cntCol 1))
             );end while colonne
             
             (set! startx 0)
             (set! starty (+ starty layerHeight))
             (set! cntRow (+ cntRow 1))
             (set! cntCol 0)
         
         );end while righe
         
         ;(gimp-display-new imageID)
                (gimp-displays-flush)
                
            ); cond 1
            
            (    else (gimp-message "File errato")
            ); cond 2
        );cond
        
        (close-input-port openFile)


    );let
);def


(script-fu-register
"script-fu-image-join"
 _"<Toolbox>/Xtns/ATG/Image join"
"It reconstructs an image subdivided with image-slice script-fu."
"Arch. Giuseppe Conte"
"2009, Conte Giuseppe"
"20 marzo, 2009 - Ver. 1.0"
    ""
SF-FILENAME "Apri file " (string-append "" gimp-data-dir "*.rcm" )

)

Print this item

Photo My First Work in Gimp
Posted by: Kal.El - 12-17-2017, 03:29 AM - Forum: Gallery - Replies (3)

Hello everyone,

I've been able to install and use everything on LINUX MINT , including gimp is unreachable and extremely good to work on, and Gimp is really very good ...

Have been crazy days, but finally I am very happy with my choice ..

This work is based on the music of George Harrison WAH-WAH

I did it because I'm finally using Gimp on Linux Mint and no longer need to use Win10 and not even Ps

(Wah-wah)
Now, I don't need no wah-wah
And I know how sweet life can be
If I keep myself free of
(Wah-wah)  
I don't need no
(Wah-wah)
 

 
https://youtu.be/jucoFPRxaEo

Thank you for everyone who made video tutorials for gimp



Attached Files Image(s)
   
Print this item

Question Python-Fu · Get viewport position
Posted by: guiritter - 12-16-2017, 04:15 PM - Forum: Scripting questions - Replies (3)

Hi everyone.

I'm writing a plugin to automate some processes. I'm sticking to Python because I've had issues with C and Scheme.

Consider an image opened in GIMP with a zoom large enough to cause only part of the image to be seen. So, you can scroll the viewport around to see other parts of the image.

I want to know what code I have to use to know which pixels are visible, so I can add a layer to the image to a position where it will be visible in my current zoom setting.

I'm using GIMP 2.8.20 on Windows 7 Ultimate x64.

Thanks in advance.

Print this item

  Coordinate System in Inkscape
Posted by: Espermaschine - 12-16-2017, 09:40 AM - Forum: Other graphics software - Replies (3)

Quick question about Inkscape, the tiled clones dialogue and the coordinate system it uses.

Lets say i clone a square 10 Rows x 10 Columns, with a
Shift Y of 10% per Row and Shift X of 10% per Column.

I also want a stair effect per column of one square:
Shift Y per Column 100 + 10 for the gap compensation = 110%.

It works as expected, but when i look at the coordinate system, i get the impression something is wrong.

   

Negative displacements are to the left and to the bottom.

   

By that logic, i should have used:
Shift Y -10% per Row
and
Shift Y -110% per Column

But that gives me something entirely different...

Where is the mistake in my thinking ??
Or is my coordinate system the wrong way around ?

   

Print this item

  Curve Tool mysterious x:
Posted by: Laserulo - 12-16-2017, 08:37 AM - Forum: General questions - Replies (3)

When I open my curve tool I find there is a vertical line with the label 'x:193' where the number is a position on the horizontal axis. This position is never the same i.e. it varies from one image to another. I've tried to deduce what it means but am at a loss. Gimp context help provides no clues. Any suggestions?

Print this item

  Switching to RGB and Back to File's Color Profile?
Posted by: TechnicGeek - 12-16-2017, 06:27 AM - Forum: General questions - Replies (1)

Sometimes when I open files I get the following dialog:

   

Does that mean for example if I opened file with Epson RGB Profile, I have to convert to RGB to work with it and then at the end of my project convert back to Epson RGB?

Are there CMYK profiles that files have? Like if I open design for print with CMYK profile, must I convert it to RGB to work with it or I can work without conversion?

The goal is to have completed project print-ready.

Thanks

Print this item

  First impression
Posted by: highbaser - 12-15-2017, 10:24 PM - Forum: Gimp 2.10 - Replies (4)

Recently saw screenshots on GIMP's Official Twitter.

To be straightforward, thanks for ruining the user interface with that corporate-idealist flat design, hard to recognize de-colored icons and the mockery of the new Photoshop UI.

Now please tell me, how to restore old themes, icons and layout of GIMP 2.8.

Print this item

  How to Batch Convert to Indexed Using Specific Palette?
Posted by: Vespin - 12-15-2017, 09:31 PM - Forum: Extending the GIMP - No Replies

Hi all! I'm fairly basic with GIMP, which is why I need help with this issue. I'm looking to batch convert a series of images to 256 colors using the same palette for each image (and reduced color bleeding dithering, and removing unused colors). I'm pretty sure there's a way to do this with GIMP, but I'm finding the procedure list (and how to use it) somewhat intimidating.

Any help would be greatly appreciated, thanks!

Print this item

  Select by Color
Posted by: rich2005 - 12-15-2017, 11:50 AM - Forum: Gimp 2.10 - No Replies

This is Gimp 2.9.9 and although this feature has been included since Gimp 2.9.5 worth a mention.

The Select by Color tool still has the select-by options same as Gimp 2.8.x with some additions reflecting the added color spaces, hue-saturation-value (HSV) and luminance-chroma-hue (LCH)

Tucked under those, a draw mask tick box to give a preview of the areas affected by the selection.

   

Print this item

  understanding brush dynamics (angle jitter)
Posted by: Espermaschine - 12-14-2017, 09:32 AM - Forum: General questions - Replies (5)

I want an arrow that wiggles a little bit, as i drag the brush along.

Im not sure i understand the dynamics curves fully....

So on the left side i have 'Angle' and on the right side 'Randomness', right ?

But when i turn up 'Angle', the arrows wiggle to the right and when i restrict 'Randomness', they wiggle to the left.

What is the logic behind this ? 

   

Print this item