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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 4,608
» Latest member: Aaronnef
» Forum threads: 7,474
» Forum posts: 40,821

Full Statistics

Latest Threads
Blur/Sharp tool
Forum: General questions
Last Post: denzjos
1 hour ago
» Replies: 2
» Views: 126
3.0.4 Crashes when drag a...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: kayalif
Yesterday, 06:16 PM
» Replies: 6
» Views: 211
Crop Layer To Selection
Forum: Gimp 2.99 & Gimp 3.0
Last Post: ips
07-10-2025, 06:49 PM
» Replies: 3
» Views: 664
technology against mosqui...
Forum: Watercooler
Last Post: denzjos
07-10-2025, 05:38 PM
» Replies: 2
» Views: 165
script does not appears i...
Forum: Extending the GIMP
Last Post: Zydelum
07-10-2025, 05:05 PM
» Replies: 2
» Views: 181
script not available
Forum: Extending the GIMP
Last Post: Zydelum
07-10-2025, 04:33 PM
» Replies: 0
» Views: 95
Open, save buttons on bot...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: gilmoreja
07-10-2025, 04:01 PM
» Replies: 7
» Views: 2,738
GEGL Plugins for GIMP 3.0...
Forum: Extending the GIMP
Last Post: BeaverGEGLFreak
07-09-2025, 10:55 PM
» Replies: 0
» Views: 152
GIMP - 3.0.4 - perspectiv...
Forum: Gimp 2.99 & Gimp 3.0
Last Post: rich2005
07-09-2025, 12:11 PM
» Replies: 1
» Views: 179
Switching off a drop-list...
Forum: General questions
Last Post: Ofnuts
07-09-2025, 06:52 AM
» Replies: 1
» Views: 193

 
  How to change a script to work with alpha channel?
Posted by: mholder - 10-06-2017, 03:17 PM - Forum: General questions - Replies (5)

There is a script called 'tile_shuffle.scm', and I want to edit it a little.

This script does not work with alpha channels.  Is there any way to edit it to shuffle tiles with alpha values?
 

Here's the script:

Code:
; tile_shuffle.scm
; by Rob Antonishen
; http://ffaat.pointclark.net

; Version 1.0 (20090118)

; Description
; Shuffles tiles of the image

; 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.
;
; The GNU Public License is available at
; http://www.gnu.org/copyleft/gpl.html
(define (script-fu-tile_shuffle img inLayer inX inY)
(let* (
        (width (car (gimp-image-width img)))
        (height (car (gimp-image-height img)))
        (inX (min inX width))
        (inY (min inY height))        
        (xTiles (trunc (/ width inX)))
        (yTiles (trunc (/ height inY)))        
        (tile1 0)
        (newlayer 0)
        (x0 0)
        (y0 0)
        (x1 0)
        (y1 0)
        (counter 0)
        (swap 0)
        (temp 0)
        (tilelist (cons-array (* xTiles yTiles) 'double))
        (mode (car (gimp-layer-get-mode inLayer)))
        )

    (gimp-context-push)
    (gimp-image-undo-group-start img)
    ; set up progress bar
    (gimp-progress-set-text _"Shuffling Tiles")
    
    ;fill list
    (while (< counter (* xTiles yTiles))
    (begin
        (aset tilelist counter counter)
        (set! counter (+ counter 1))
    )
    )
    
    ;shuffle list
    (while (> counter 1)
    (begin
        (set! swap (rand counter))
        (set! counter (- counter 1))
        (set! temp (vector-ref tilelist counter))
        (aset tilelist counter (vector-ref tilelist swap))
        (aset tilelist swap temp)
    )
    )

    ;create a working layer
    (set! newlayer (car (gimp-layer-new-from-drawable inLayer img)))
    (gimp-image-add-layer img newlayer (car (gimp-image-get-layer-position img inLayer)))        
    (gimp-layer-set-mode newlayer NORMAL-MODE)

    ;cut and paste tiles based on the shuffled array
    (set! counter 0)
    (while (< counter  (* xTiles yTiles) )
    (begin
        (gimp-progress-update (/ counter (+ (* xTiles yTiles) (if (> (remainder width inX) 0) yTiles 0) (if (> (remainder height inY) 0) xTiles 0) )))  ;update progress bar
        (set! x0 (* (* (remainder counter xTiles)) inX))
        (set! y0 (* (trunc (/ counter xTiles)) inY))

        (set! x1 (* (* (remainder (vector-ref tilelist counter) xTiles)) inX))
        (set! y1 (* (trunc (/ (vector-ref tilelist counter) xTiles)) inY))
        
        (gimp-rect-select img x0 y0 inX inY CHANNEL-OP-REPLACE FALSE 0)
        (gimp-edit-copy inLayer)
        (set! tile1 (car (gimp-edit-paste newlayer FALSE)))

        (set! tile1 (car (gimp-drawable-transform-2d-default tile1 x0 y0 1 1 0 x1 y1 FALSE 0)))
        
        (set! counter (+ counter 1))
    )
    )    
    (gimp-floating-sel-anchor tile1)

    ;edge tiles
    (if (> (remainder width inX) 0)
    (begin
        (set! tilelist (cons-array yTiles 'double))
        (set! counter 0)
        ;fill list
        (while (< counter yTiles)
        (begin
            (aset tilelist counter counter)
            (set! counter (+ counter 1))
        )
        )

        ;shuffle list
        (while (> counter 1)
        (begin
            (set! swap (rand counter))
            (set! counter (- counter 1))
            (set! temp (vector-ref tilelist counter))
            (aset tilelist counter (vector-ref tilelist swap))
            (aset tilelist swap temp)
        )
        )

        ;vertical edge
        (set! x0 (* xTiles inX))
        (set! x1 (* xTiles inX))
        
        ;cut and paste tiles based on the shuffled array
        (set! counter 0)
        (while (< counter yTiles)
        (begin
            (gimp-progress-update (/ (+ counter (* xTiles yTiles)) (+ (* xTiles yTiles) (if (> (remainder width inX) 0) yTiles 0) (if (> (remainder height inY) 0) xTiles 0))))  ;update progress bar
            (set! y0 (* counter inY))
            (set! y1 (* (vector-ref tilelist counter) inY))
        
            (gimp-rect-select img x0 y0 (remainder width inX) inY CHANNEL-OP-REPLACE FALSE 0)
            (gimp-edit-copy inLayer)
            (set! tile1 (car (gimp-edit-paste newlayer FALSE)))

            (set! tile1 (car (gimp-drawable-transform-2d-default tile1 x0 y0 1 1 0 x1 y1 FALSE 0)))
        
            (set! counter (+ counter 1))
        )
        )
        (gimp-floating-sel-anchor tile1)
    )
    )

    ;edge tiles
    (if (> (remainder height inY) 0)
    (begin
        (set! tilelist (cons-array xTiles 'double))
        (set! counter 0)
        ;fill list
        (while (< counter xTiles)
        (begin
            (aset tilelist counter counter)
            (set! counter (+ counter 1))
        )
        )

        ;shuffle list
        (while (> counter 1)
        (begin
            (set! swap (rand counter))
            (set! counter (- counter 1))
            (set! temp (vector-ref tilelist counter))
            (aset tilelist counter (vector-ref tilelist swap))
            (aset tilelist swap temp)
        )
        )

        ;horizontal edge
        (set! y0 (* yTiles inY))
        (set! y1 (* yTiles inY))

        ;cut and paste tiles based on the shuffled array
        (set! counter 0)
        (while (< counter xTiles)
        (begin
            (gimp-progress-update (/ (+ counter (* xTiles yTiles) xTiles) (+ (* xTiles yTiles) (if (> (remainder width inX) 0) yTiles 0) (if (> (remainder height inY) 0) xTiles 0))))  ;update progress bar
            (set! x0 (* counter inX))
            (set! x1 (* (vector-ref tilelist counter) inX))
        
            (gimp-rect-select img x0 y0 inX (remainder height inY) CHANNEL-OP-REPLACE FALSE 0)
            (gimp-edit-copy inLayer)
            (set! tile1 (car (gimp-edit-paste newlayer FALSE)))

            (set! tile1 (car (gimp-drawable-transform-2d-default tile1 x0 y0 1 1 0 x1 y1 FALSE 0)))
        
            (set! counter (+ counter 1))
        )
        )
        (gimp-floating-sel-anchor tile1)
        
    )
    )

    (set! inLayer (car (gimp-image-merge-down img newlayer  EXPAND-AS-NECESSARY)))
    (gimp-layer-set-mode inLayer mode)
    
    (gimp-progress-end)
    (gimp-image-undo-group-end img)
    (gimp-displays-flush)
    (gimp-context-pop)
)
)


(script-fu-register "script-fu-tile_shuffle"
                    "<Image>/Filters/Distorts/_Tile Shuffle..."
                    "Shuffles image tiles"
                    "Rob Antonishen"
                    "Rob Antonishen"
                    "Jan 2009"
                    "RGB* GRAY*"
                    SF-IMAGE       "Image"         0
                    SF-DRAWABLE    "Drawable"      0
                    SF-ADJUSTMENT  "Tile X Size"          (list 100 4 1000 1 10 0 SF-SLIDER)
                    SF-ADJUSTMENT  "Tile Y Size"          (list 100 4 1000 1 10 0 SF-SLIDER)
                    )

Print this item

Music Help with editing an image like The National album art
Posted by: pter86 - 10-06-2017, 02:56 PM - Forum: General questions - Replies (3)

Hello,


I was hoping somebody could advise me on how to create a similar effect to the duotone images from the new National album Sleep Well Beast.

I would like to create a similar blue toned image like the one attached. Any advice appreciated.

Thank you [Image: smile.gif]

   

Print this item

Tongue Gimp makeup
Posted by: gbarkovalev - 10-06-2017, 11:46 AM - Forum: Gallery - Replies (1)

[Image: 9cSHyHX.jpg]

Angel

Print this item

  cut shapes out of digital paper
Posted by: kbrown2509 - 10-04-2017, 11:18 PM - Forum: General questions - Replies (1)

Hi, I am very new to GIMP and I am wanting to use it for digital scrapbooking. I have downloaded some papers and elements and can add them to my photos to create a page.  What I want to do now is to create a shape (flower) or trace an existing one and then cut it out of my exisiting digital papers.  Can anyone advise how this can be done.  Cheers

Print this item

  The beginning of the end
Posted by: Ofnuts - 10-04-2017, 07:48 PM - Forum: Gimp-Forum.net - Replies (12)

Plenty of new and very active users on GimpForums

[Image: srGEeA2.png]

Print this item

  clone tool in xubuntu 16.04
Posted by: petter5 - 10-04-2017, 02:49 PM - Forum: General questions - Replies (2)

clone tool in xubuntu 16.04

Hi ! My first post to this forum. When using windows, the clone tool works as expected. Using Xubuntu 16.04 - the clone tool does not perform any clone operation after pressing ctrl+click as usual and start to clone - you can see the +is following, but the area to clone does not fill up with the cloned area.

According to google search "xubuntu show mouse position on Control" there could be due to a mouse pointer setting, but really - I have been unable to find any solution to get this to work. Since I prefer Linux 99% over windows, I would appreciate help to get this to work also under Ubuntu.

Print this item

  Cropping - Custom Crop Guides
Posted by: SpiDeeWebb - 10-04-2017, 07:33 AM - Forum: General questions - Replies (5)

Hello All,

Bottom Line Up Front: I want to create a new cropping guide for passports.

I'm having a little trouble with terminology. 

I can't figure out what the heck developers refer to these as.

I'm seeing under the presets they're just referred to simply as 'guide center-line' 'guide rule-of-thirds.'
I thought it'd be a simple matter of loading it up in GCC searching the right term, and playing around with it.

I just can't for the life of me find them to begin with.

Print this item

Sad Strange Filter Behaviour - Filter GUI not interacting
Posted by: SamPat - 10-03-2017, 07:37 PM - Forum: Installation and usage - Replies (4)

Hey Guys and Gals,

I've got a strange problem I couldn't find the answer to on the internet.

I have a new layer with some text and select that text to treat it with a gaussian blur. But when I select the filter in the filter dropdown menu I cannot interact with the filter GUI. I can't check or uncheck the preview box and interact with the parameters. I even cannot exit the window via the "cancel" button, only by pressing escape.

Restarting my mac or reinstalling GIMP didn't work so now I'm stranded. 

Somebody knows anything?

Kind Regards

Print this item

  Dark GIMP Theme (Based on Advaita Dark desktop theme)
Posted by: justusr846 - 10-03-2017, 04:05 PM - Forum: Extending the GIMP - Replies (1)

Hey guys,

This is a dark theme based on the Advaita Dark theme for GNOME. I modified the gtkrc file (with a lot of trial and error) and merged files from Advaita and the default 'Dark' theme to get this. It was made with GIMP 2.97, so I'm not sure it works with older versions.

   



It was made as a standalone because using Advaita Dark as the system theme interferes with other applications, like the browser etc.

Download the theme file here:
.zip   Advaita Dark GIMP Theme.zip (Size: 160.29 KB / Downloads: 2207)



How to install (for newbies),

Extract the file to the 'themes' folder within GIMP.

Then open GIMP, Go to Edit --> Preferences --> Themes --> Advaita Dark





There are still a couple of things I noticed that needed fixing, but I haven't figured out how to solve them yet. Like...



This outline that comes around the recently accessed button.
   



The system theme based outline color around the panels (which I think would be better if it was something dark)
   



...and to match the color of the ruler to the tab.
   


Also I don't know if any better dark themes are available.... and all this might be irrelevant.  ^_^



Updates:

4/10/2017 - Theme file replaced. (Updated the scrollbar)

Print this item

  No info when hoovering mouse over icon[Solved]
Posted by: AnalogueMan - 10-03-2017, 03:51 PM - Forum: General questions - Replies (2)

Hello, newbee here. I have Gimp version 2.8.22 installed on my computer with PCLinuxOS
64bit KDE5 as O.S.
But when I hoover with my mouse over for instance an icon in the toolbox the pop-up square is empty.
What did I forgot to do?

Print this item