Share this topic on AskShare this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on TwitterShare this topic on YahooShare this topic on Google buzz

Author Topic: [Script-Fu] Hidden Watermarks  (Read 1264 times)

0 Members and 1 Guest are viewing this topic.

Offline Darth_Gimp

  • Number One
  • *****
  • Posts: 2,833
  • Karma: 0
  • Faith, Folk, Family!
    • lds-jedi.deviantart.com
    • Odinic Rite
[Script-Fu] Hidden Watermarks
« Reply #20 on: March 23, 2010, 09:21:34 PM »
where is a link to the script?
GimpDome Group: http://gimpdome.deviantart.com/
My DeviantArt: http://lds-jedi.deviantart.com/

There's no worse feeling than that millisecond you're sure you are going to die after leaning your chair back a little too far.

Offline gimprotect

  • Member
  • **
  • Posts: 51
  • Karma: 0
[Script-Fu] Hidden Watermarks
« Reply #21 on: March 24, 2010, 01:17:32 AM »

where is a link to the script?

Thanks for your willingness to contribute, Darth_Gimp! You´ll find the code of the script on the bottom of THIS POST. Have a good one! :)

-gimprotect
« Last Edit: March 24, 2010, 01:19:28 AM by gimprotect »
Check it Out: Hidden Watermarks in GIMP Thanks fence!

Offline Darth_Gimp

  • Number One
  • *****
  • Posts: 2,833
  • Karma: 0
  • Faith, Folk, Family!
    • lds-jedi.deviantart.com
    • Odinic Rite
[Script-Fu] Hidden Watermarks
« Reply #22 on: March 24, 2010, 09:10:46 AM »


That's the settings I used, but nothing happened Fence. The folders are created on my desktop and I am using Ubuntu Linux 9.10
GimpDome Group: http://gimpdome.deviantart.com/
My DeviantArt: http://lds-jedi.deviantart.com/

There's no worse feeling than that millisecond you're sure you are going to die after leaning your chair back a little too far.

Offline fencepost

  • Member
  • **
  • Posts: 2,626
  • Karma: 0
    • fence-post.deviantart.com
[Script-Fu] Hidden Watermarks
« Reply #23 on: March 24, 2010, 09:38:59 AM »
Thanks for trying.  This is distressing since I'm using code that was known to work with Linux systems.  I did find one thing that might have created the problem and fixed it with the code below.  Please try that and let me know your results.  If I can't resolve the save issue, I'll ask someone on another forum for assistance.  If that doesn't work, I'll have to give up because if the save option doesn't work, there's need to pursue it any further.

Code: [Select]
(define (fp-script-fu-watermark load pattern position color opacity azimuth elevation depth waterlevel ambient compensate invert type location filename )

(let* (

(filelist (cadr (file-glob (string-append load "\\*" ".jpg") 1)))
(s 1)
(count (car (file-glob (string-append load "\\*" ".jpg") 1)))
(drawable 0)
(patWidth (car (gimp-pattern-get-info pattern)))
(patHeight (cadr (gimp-pattern-get-info pattern)))
(patLayer 0)
(active 0)
(bumpLayer 0)
(filename2 0)
(offsetX 0)
(offsetY 0)
(imageWidth 0)
(imageHeight 0)


)





(while (pair? filelist)
(let* (
(loadfile (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE loadfile loadfile)))
)

;(gimp-display-new image)
(set! imageWidth (car (gimp-image-width image)))
(set! imageHeight (car (gimp-image-height image)))


(cond
  ( (= position 1) ; top right
(set! offsetX (- imageWidth patWidth))
  )

( (= position 2) ; center
(set! offsetX (- (/ imageWidth 2) (/ patWidth 2)))
  (set! offsetY (- (/ imageHeight 2) (/ patHeight 2)))
)


( (= position 3) ; bottom left
(set! offsetY (- imageHeight patHeight))
)

  ( (= position 4) ; bottom right
(set! offsetX (- imageWidth patWidth))
(set! offsetY (- imageHeight patHeight))
  )

)

(set! patLayer (car (gimp-layer-new image patWidth patHeight RGBA-IMAGE "Pattern Layer" opacity NORMAL-MODE)))
(set! bumpLayer (car (gimp-image-get-active-layer image)))
(gimp-drawable-fill patLayer TRANSPARENT-FILL)
(gimp-drawable-fill patLayer PATTERN-FILL)
(gimp-image-add-layer image patLayer -1)
(gimp-layer-set-offsets patLayer offsetX offsetY)
(gimp-layer-set-lock-alpha patLayer TRUE)
(gimp-context-set-foreground color)
(gimp-edit-fill patLayer FOREGROUND-FILL)
(gimp-displays-flush)
(gimp-layer-resize-to-image-size patLayer)
(plug-in-bump-map RUN-NONINTERACTIVE image bumpLayer patLayer azimuth elevation depth 0 0 waterlevel ambient compensate invert type)
(set! active (car (gimp-image-flatten image)))
(gimp-displays-flush)
(set! filename2 (string-append location "/" filename (string-append (number->string s))".jpg"))
(gimp-file-save RUN-NONINTERACTIVE image active filename2 filename2)
(set! s (+ s 1))
(gimp-image-delete image)
(set! count (- count 1))
(set! filelist (cdr filelist))
))
)
)
(script-fu-register "fp-script-fu-watermark"
"<Image>/File/Watermark..."
"Adds a bump mapped watermark to a folder of jpg images."
"Art Wade"
"Art Wade"
"March 2010"
""

SF-DIRNAME   "Load pictures from" ""
SF-PATTERN    "Pattern to use as bump map watermark" "Watermark"
SF-OPTION     "Watermark position" '("Upper Left" "Upper Right" "Center" "Lower Left" "Lower Right")
SF-COLOR      "Watermark color" '(255 255 255)
SF-ADJUSTMENT "Watermark opacity" '(100.0 0.0 100.0 1 10 1 0)
SF-ADJUSTMENT "Bump map azimuth" '(50.0 0.0 360.0 1 10 1 0)
SF-ADJUSTMENT "Bump map elevation" '(45.0 0.5 90.0 1 10 1 0)
SF-ADJUSTMENT "Bump map depth" '(2 1 65 1 10 0 0)
SF-ADJUSTMENT "Bump map waterlevel" '(0 0 255 1 10 0 0)
SF-ADJUSTMENT "Bump map ambient" '(0 0 255 1 10 0 0)
SF-TOGGLE   "Bump map compensate for darkening" TRUE
SF-TOGGLE   "Bump map invert" FALSE
SF-OPTION     "Bump map type" '("LINEAR" "SPHERICAL" "SINUSOIDAL")
SF-DIRNAME    "Save pictures to" "Save To"
    SF-STRING     "Name for watermarked images" "filename"

)
« Last Edit: March 24, 2010, 09:40:43 AM by fencepost »
I'd rate you as an upper-middle-lower-mod with pro-novice-inter tendencies.....and a twist of lime!  Of course, my rating scale is completely objectively subjective, but ALWAYS consistently inconsistent.

Offline gimprotect

  • Member
  • **
  • Posts: 51
  • Karma: 0
[Script-Fu] Hidden Watermarks
« Reply #24 on: March 24, 2010, 09:48:14 AM »

Please try that and let me know your results.

Thanks for your undurance, Fence! Over here on MAC the script neither creates a folder, nor saves an image to the desktop. 
Let´s wait for Darth_Gimps test on your new script before you move on to ask for assistance on the other forum.

-gimprotect
Check it Out: Hidden Watermarks in GIMP Thanks fence!


Offline fencepost

  • Member
  • **
  • Posts: 2,626
  • Karma: 0
    • fence-post.deviantart.com
[Script-Fu] Hidden Watermarks
« Reply #25 on: March 24, 2010, 09:51:13 AM »
The script won't create a new folder, but if you're specifying that it should be saved to the desktop, then you should at least have images showing up.  I suggest you try out the new script because it needs to work on all platforms.  Just copy and paste the code over top of the old code and save.  Refresh your scripts and try again.

Art
I'd rate you as an upper-middle-lower-mod with pro-novice-inter tendencies.....and a twist of lime!  Of course, my rating scale is completely objectively subjective, but ALWAYS consistently inconsistent.

Offline gimprotect

  • Member
  • **
  • Posts: 51
  • Karma: 0
[Script-Fu] Hidden Watermarks
« Reply #26 on: March 24, 2010, 10:07:40 AM »

The script won't create a new folder, but if you're specifying that it should be saved to the desktop, then you should at least have images showing up.
I suggest you try out the new script because it needs to work on all platforms.  Just copy and paste the code over top of the old code and save.  Refresh your scripts and try again.

Ack, I assumed you knew that I already used the new script within my previous post. The script runs and no files are saved to any place. Hold tight!

-gimprotect
« Last Edit: March 24, 2010, 10:08:06 AM by gimprotect »
Check it Out: Hidden Watermarks in GIMP Thanks fence!

Offline Darth_Gimp

  • Number One
  • *****
  • Posts: 2,833
  • Karma: 0
  • Faith, Folk, Family!
    • lds-jedi.deviantart.com
    • Odinic Rite
[Script-Fu] Hidden Watermarks
« Reply #27 on: March 24, 2010, 10:32:39 AM »
Ok Fence.. used the new script and I am sorry to report the same issue with the same settings. Not sure why its not working out.
GimpDome Group: http://gimpdome.deviantart.com/
My DeviantArt: http://lds-jedi.deviantart.com/

There's no worse feeling than that millisecond you're sure you are going to die after leaning your chair back a little too far.

Offline fencepost

  • Member
  • **
  • Posts: 2,626
  • Karma: 0
    • fence-post.deviantart.com
[Script-Fu] Hidden Watermarks
« Reply #28 on: March 24, 2010, 11:54:21 AM »
No worries.  I'll request for some help and if I can't resolve the problem, I'll quit this script and mark it down as good experience.

A
I'd rate you as an upper-middle-lower-mod with pro-novice-inter tendencies.....and a twist of lime!  Of course, my rating scale is completely objectively subjective, but ALWAYS consistently inconsistent.

Offline Darth_Gimp

  • Number One
  • *****
  • Posts: 2,833
  • Karma: 0
  • Faith, Folk, Family!
    • lds-jedi.deviantart.com
    • Odinic Rite
[Script-Fu] Hidden Watermarks
« Reply #29 on: March 24, 2010, 12:56:23 PM »
I just really don't like giving bad news.. but then, if you didn't know then you won't get even better than you are. .. right?
GimpDome Group: http://gimpdome.deviantart.com/
My DeviantArt: http://lds-jedi.deviantart.com/

There's no worse feeling than that millisecond you're sure you are going to die after leaning your chair back a little too far.


Tags:
 

anything