It is currently Fri Mar 29, 2024 1:03 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 49 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 5:02 am  (#1) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
I downloaded a lot of Gradients and there are so many real pretty ones in the packages. Does anyone know or can a script be made to view these gradients without installing them. There is a font viewer which works great, so I was wondering if the same thing can apply to gradients. They are all ggr files.

_________________
Image


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 5:13 am  (#2) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
No but once i asked a script to (batch)convert gradients to images , and RobA prepared one , maybe that could help , i did found very helpful

I am not too good with forum search i didn't find yet the topic because i don't remember exactly the title, it was in this board , was a topic open by me ...maybe you are more lucky with search

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 5:17 am  (#3) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Thanks PC, I will try to find it.

_________________
Image


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 5:59 am  (#4) 
Molly, your favourite 'windoze' program 'Change Image' (the one that lets you create a gradient from an image) has a Gradient Browser under the file menu.
That will do what you want, without having to install the gradients.
I have attached it in case you no longer have it.


Attachments:
ChangeImage v.1.0.1.2_0.zip [718.86 KiB]
Downloaded 162 times
Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 6:05 am  (#5) 
PhotoComix wrote:
No but once i asked a script to (batch)convert gradients to images , and RobA prepared one , maybe that could help , i did found very helpful

I am not too good with forum search i didn't find yet the topic because i don't remember exactly the title, it was in this board , was a topic open by me ...maybe you are more lucky with search

I think this is the one you are referring to, but I don't think it is what molly is seeking.


Attachments:
export-gradients.scm [2.82 KiB]
Downloaded 93 times
Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 7:06 am  (#6) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Thank you fluffy, I did see that one by RobA.
What I would like is to be able to see what the gradients look like without installing them, like you can with Font viewer. I was thinking that one of our great script writers could make a script that will do this.

_________________
Image


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 7:25 am  (#7) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Sorry, fluffy, I didn't know you had posted twice. So if this will let me see gradients without installing them, I would have to go to Windoze. I do still have that little program there.
I will go there later today and try it out. It would be worth my while, then I could copy the ones I want to my USB and truck them back over to Fedora.
Thank you.

_________________
Image


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 7:30 am  (#8) 
molly wrote:
Sorry, fluffy, I didn't know you had posted twice. So if this will let me see gradients without installing them, I would have to go to Windoze. I do still have that little program there.
I will go there later today and try it out. It would be worth my while, then I could copy the ones I want to my USB and truck them back over to Fedora.
Thank you.

No problems, the gradient browser is only in the later version of Change Image, if you don't see the option in yours, download the version attached in my message. :)


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 7:32 am  (#9) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
will do, thanks,

_________________
Image


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 8:59 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Change Image is a great little tool for browsing gradients in any folder so i think it most definitely is what you are looking for Molly.

Image

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 9:10 am  (#11) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Yes it sure is that alright. I have been using it for years, but it isn't available in Linux. That is the only draw back. I just viewed a lot of the gradients I downloaded from Odin's post and it is fantastic. I had the older version but now have the upgraded one that Fluffy pasted. It has also been translated into English along with the original language.

Thanks also to fluffy for posting the newest version.

Image

Image

_________________
Image


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 9:13 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
The src code is available but i am not too certain it is possible to compile a Linux binary from it. It is VB (Visual Basic) i believe. Your best bet would be to talk to Sam about compiling it for a Linux environment.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 9:15 am  (#13) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
I think I would even beg for that one... :teeth It is a jewel. :bigthup

_________________
Image


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 9:20 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
molly wrote:
I think I would even beg for that one... :teeth It is a jewel. :bigthup


I agree. :bigthup

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 9:25 am  (#15) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
start-a-beggin

_________________
Image


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 1:33 pm  (#16) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2414
@Molly

Maybe one of your Fedora buddies can sort out something like this for you.

This is a composite from screenshots

Image

1. Just the straight Shellout plugin modified to call changeimage.exe rather than XnView. Plus of course the menu entry changed. I did try incorporating changeimage.exe into the Shellout menu, for whatever reason I can not get it to work, maybe on of the clever people can.

2. For convenience I dumped changeimage.exe along with XnView rather than having it alone in a separate directory. Still using windows temp as the temporary directory for when I want to generate a gradient.

3. In this case, just want the Gradient browser which works fine.

Using PClinuxOS 32 bit KDE, WINE 1.4, ShellOut 0.5 (mod) and of course Gimp 2.8.8

_________________
Image


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 1:59 pm  (#17) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Be aware that the previews provided by that program are limited to the functionality of SVG gradients and may not be representative of exactly how a GIMP gradient would appear in actual use.

For example, the following GIMP image shows six different possible blends from red to blue; however, only the top one can be produced with an SVG gradient. GIMP is also able to mix segments of these different types within a single gradient.
Attachment:
blends.jpg
blends.jpg [ 23.17 KiB | Viewed 1313 times ]


Unfortunately, GIMP does not provide a means for a plug-in to load individual gradients and so in order to generate previews it is necessary to play around with the contents of the directories that GIMP loads its gradients from.

I have written a shell script (in the spoiler tags below) that uses GIMP to generate an XCF file containing a preview layer for each gradient in a specified directory. (EDIT: the script is now available for download from here.) The script is invoked from the command line (GNU/Linux only) as follows:

./preview-gradients.sh /path/to/gradients/ filename.xcf

You can save the script as something other than 'preview-gradients.sh' if you wish. Remember to make the script executable (using 'chmod +x preview-gradients.sh' or somesuch).

Here is a screenshot of the image that is produced from a directory containing three .ggr files:

Attachment:
layerstack.jpg
layerstack.jpg [ 301.6 KiB | Viewed 1313 times ]


#!/usr/bin/env bash

if [ $# -ne 2 ] ; then
  echo Usage: $0 gradient-folder savefile.xcf
  exit 1
fi

G2_DATADIR=$(mktemp -d -t gimp.XXXXXX)

ORIG_DATADIR=${GIMP2_DATADIR:-/usr/share/gimp/2.0}

cp -rf $ORIG_DATADIR/* $G2_DATADIR
rm -rf $G2_DATADIR/gradients/* 2>/dev/null
cp -f $1/*.ggr $G2_DATADIR/gradients
tee $G2_DATADIR/scripts/preview.scm >/dev/null <<EOF
(define (preview-grad xcf-filename)
  (define PREVIEW-SIZE 800)
  (let ((image (car (gimp-image-new PREVIEW-SIZE PREVIEW-SIZE RGB))))
    (gimp-image-undo-disable image)

    (let ((loaded-gradients (cadr (gimp-gradients-get-list ""))))
      (gimp-gradients-refresh)
      (let loop ((gradients (cadr (gimp-gradients-get-list ""))))
        (unless (null? gradients)
          (if (member (car gradients) loaded-gradients)
            (loop (cdr gradients))
            (let ((layer (car (gimp-layer-new image
                                              PREVIEW-SIZE
                                              PREVIEW-SIZE
                                              RGB-IMAGE
                                              "layer"
                                              100
                                              NORMAL-MODE ))) )
              (gimp-image-add-layer image layer 0)
              (gimp-context-set-foreground '(102 102 102))
              (gimp-context-set-background '(153 153 153))
              (plug-in-checkerboard RUN-NONINTERACTIVE image layer 0 (/ PREVIEW-SIZE 100))
              (gimp-context-set-default-colors)
              (gimp-drawable-set-name layer (car gradients))
       
              (let ((name (car gradients)))
                (gimp-context-set-gradient name)
                (gimp-rect-select image 0 0 (/ PREVIEW-SIZE 2) (/ PREVIEW-SIZE 2)
                                             CHANNEL-OP-REPLACE FALSE 0 )
                (gimp-edit-blend layer CUSTOM-MODE NORMAL-MODE GRADIENT-LINEAR 100
                                 0 REPEAT-NONE FALSE TRUE 3 3 FALSE
                                 0 0 (/ PREVIEW-SIZE 2) 0 )
                (gimp-rect-select image (/ PREVIEW-SIZE 2) 0 (/ PREVIEW-SIZE 2) (/ PREVIEW-SIZE 2)
                                             CHANNEL-OP-REPLACE FALSE 0 )
                (gimp-edit-blend layer CUSTOM-MODE NORMAL-MODE GRADIENT-RADIAL 100
                                 0 REPEAT-NONE FALSE TRUE 3 3 FALSE
                                 (* 0.75 PREVIEW-SIZE) (* 0.25 PREVIEW-SIZE)
                                 (* 0.75 PREVIEW-SIZE) (* 0.5 PREVIEW-SIZE) )
                (gimp-rect-select image 0 (/ PREVIEW-SIZE 2) (/ PREVIEW-SIZE 2) (/ PREVIEW-SIZE 2)
                                             CHANNEL-OP-REPLACE FALSE 0 )
                (gimp-edit-blend layer CUSTOM-MODE NORMAL-MODE GRADIENT-CONICAL-ASYMMETRIC 100
                                 0 REPEAT-NONE FALSE TRUE 3 3 FALSE
                                 (* 0.25 PREVIEW-SIZE) (* 0.75 PREVIEW-SIZE)
                                 (* 0.25 PREVIEW-SIZE) (/ PREVIEW-SIZE 2) )
                (gimp-rect-select image (/ PREVIEW-SIZE 2) (/ PREVIEW-SIZE 2) (/ PREVIEW-SIZE 2) (/ PREVIEW-SIZE 2)
                                             CHANNEL-OP-REPLACE FALSE 0 )
                (gimp-edit-blend layer CUSTOM-MODE NORMAL-MODE GRADIENT-SPIRAL-CLOCKWISE 100
                                 0 REPEAT-NONE FALSE TRUE 3 3 FALSE
                                 (* 0.75 PREVIEW-SIZE) (* 0.75 PREVIEW-SIZE)
                                 (* 0.75 PREVIEW-SIZE) (/ PREVIEW-SIZE 2) )
                (gimp-selection-none image) )
              (loop (cdr gradients)) )))))
    (gimp-xcf-save 0 image (car (gimp-image-get-active-layer image)) xcf-filename xcf-filename)
    (gimp-image-delete image)
    (gimp-quit 0)
    ))
EOF

export GIMP2_DIRECTORY=$(mktemp -d -t gimp.XXXXXX)
mkdir $GIMP2_DIRECTORY/gradients -p
mkdir $GIMP2_DIRECTORY/patterns -p
mkdir $GIMP2_DIRECTORY/brushes -p
GIMP2_DATADIR=$G2_DATADIR gimp -i -n -d -b "(preview-grad \"$2\")"

rm -rf $G2_DATADIR
rm -rf $GIMP2_DIRECTORY

exit 0

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Last edited by saulgoode on Sun Nov 17, 2013 9:07 pm, edited 3 times in total.

Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 2:11 pm  (#18) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
wow, that looks really cool thanks, I hope I can figure it out.
I put the scm ext on it and placed it in my user name scripts folder. I opened gimp and it is not there. Does it go into the share 2.0 folder?
Image

_________________
Image


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 2:41 pm  (#19) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Hi Molly, the script is not a Script-fu, but a BASH script that is to be run from within a terminal.

You need to first open a shell terminal and then execute the following commands:

    wget kerosenecow.net/data/GIMP/preview-gradients.sh
    chmod +x preview-gradients.sh
    ./preview-gradients.sh name-of-folder-containing-gradients/ example.xcf

The script should run for a while, depending upon how many gradients are in the specified directory, but once it is finished then you should be able to open the 'example.xcf' in GIMP. Once in GIMP, you can hold down the SHIFT key while clicking on a layer's "eyeball" in the Layers Dialog to show only that layer.

If you have any questions, feel free to ask.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Is there a script for looking at Gradients
PostPosted: Sun Nov 17, 2013 2:49 pm  (#20) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
I think I would have to use a different terminal command. I use Fedora and su - then password to get to root then yum install, or whatever that command is in Fedora

_________________
Image


Top
Post new topic Reply to topic  [ 49 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) two gradients two photos

7

No new posts Attachment(s) How to create custom gradients?

5

No new posts Attachment(s) | Solved ] Move points on gradients

2

No new posts Editing Gradients Stopped Working Overnight (Solved)

2

No new posts 11 Extra Crown Molding gradients default in my GIMP system

4



* Login  



Powered by phpBB3 © phpBB Group