support.bibblelabs.com Forum Index support.bibblelabs.com
Forums for Bibble
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

These forums are READ-ONLY.
The current forums for Bibble 5 discussions and support is at http://support.bibblelabs.com
Watermark
Goto page Previous  1, 2, 3, 4, 5  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    support.bibblelabs.com Forum Index -> Bibble Pro - General Discussion
View previous topic :: View next topic  
Author Message
afx
Bibble Expert
Bibble Expert


Joined: 21 Jul 2005
Posts: 3981
Location: Munich

PostPosted: Wed Mar 15, 2006 7:28 am    Post subject: Reply with quote

While I would like to see a generic ImageMagic plugin, I do not think a plugin is the way to go for a watermark. To me this is a property of the output batch queue just like color space or image dimension.

cheers
afx

_________________
sRGB clipping sucks
Back to top
View user's profile Send private message Visit poster's website
marcof
Bibble Expert
Bibble Expert


Joined: 14 May 2003
Posts: 1442
Location: netherlands

PostPosted: Wed Mar 15, 2006 7:34 am    Post subject: Reply with quote

afx wrote:
While I would like to see a generic ImageMagic plugin, I do not think a plugin is the way to go for a watermark. To me this is a property of the output batch queue just like color space or image dimension.

cheers
afx


agreed, but I am not aware of any development schedules (and priorities) at bibblelabs, so maybe starting with a plugin might be the most pragmatic way. Not so much an Imagemagick powered plugin, but a "real" plugin a la BPTlens for instance.

_________________
Bibble 5 RAWks!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Dale



Joined: 01 Nov 2004
Posts: 170
Location: Petawawa, On. Canada

PostPosted: Wed Mar 15, 2006 8:13 am    Post subject: Reply with quote

marcof wrote:
fwiw I posted a proposal in the SDK developer group.
not sure if anyone will pick it up, I certainly hope so, since eric said it would be "painfully easy" to do Wink


I also hope so as I've tried the other methods for windows in this thread with no luck. It would be great to have Bibble plug-in like BPTlens. Cool

_________________
Regards,
DK
___________
20D,5DMKII
Back to top
View user's profile Send private message Visit poster's website
Rob Greenstein



Joined: 12 Mar 2006
Posts: 246
Location: Woodland Hills, CA, USA

PostPosted: Mon Mar 20, 2006 8:04 am    Post subject: Reply with quote

The extremely high number of views for this thread would suggest that a Watermark capability is of great interest to many Bibble Forums readers.
Back to top
View user's profile Send private message Visit poster's website
TonyKInTexas



Joined: 14 Oct 2004
Posts: 271

PostPosted: Mon Mar 20, 2006 4:00 pm    Post subject: Reply with quote

I e-mailed asking for the plug-in SDK last week. So far I have had no response to my request.
Back to top
View user's profile Send private message
bibble
Site Admin


Joined: 30 Mar 2002
Posts: 6834
Location: Austin, Tx

PostPosted: Mon Mar 20, 2006 6:35 pm    Post subject: Reply with quote

Sorry tony, I only check that email once a week or so. I'll enable your access right now.

Of course, your always welcome to stop by the offices if you'd like too Wink

Eric
Back to top
View user's profile Send private message Visit poster's website
cogitech



Joined: 26 Feb 2005
Posts: 173

PostPosted: Thu Mar 23, 2006 5:26 pm    Post subject: Re: Wanted to post my watermark script Reply with quote

Khaytsus wrote:
Howdy.. Figured since I was on a kick of updating my watermark script, I'd post it here for other people to use.. ImageMagick is required, and it's a bash script in Linux, so might need adaptation into some other unicies, etc.. But hope it's useful to some.

I have a 800x800 max output "proof" Queue, and I now also have a duplicate of that which is a "Watermarked Proof" queue, which runs this script by checking "run in external viewer" which quietly in the background adds the watermark to the image. Adds a few seconds to each image on my AMD64 3200. Hint: Name this something like watermark.sh since Bibble looks for *.* (possibly being fixed in the near future, however..)

The cool thing is, with some help from the script earlier in this thread and the webpage the example came from, the watermarking is entirely dynamic. The text is created on the fly, so if you want to update the text you just update the script. Downside is that the font isn't fancy and there's no graphics, but that could be pretty easily added. For right now, I just wanted to reduce the possibility of clients printing my proofs I send them.

To test this, I'd suggest copying a few sizes of portrait and landscape images into a test directory and running the script on them like "watermark.sh picture.jpg" and then looking at the picture.jpg to see if the watermark looks okay. This way you can make sure that the programs this script is using are available (all should be from ImageMagick) and things are working as you expect. Once you've tested it, you can try doing it from a Bibble queue.

Code:

#!/bin/bash
         
# Text that's laid out down the middle of the image about every third.
spantext="Unlimited Photo"

# Text in the bottom-right corner of the image
copytext="Copyright Walter Francis\nhttp://unlimitedphoto.com"

# Amount that the text is lightened when composited onto the image.
disolve=35
 
### Don't think you need to edit below here unless you want to tweak.

# Determine the size of the input image..
sizetmp=`identify $1 | cut -f 3 -d " "`
sizex=`echo $sizetmp | cut -f 1 -d x`
sizey=`echo $sizetmp | cut -f 2 -d x`

# Calculate the size of the fonts based on image size
fontsize=`expr $sizex / 18`
fontsizesm=`expr $sizex / 35`
 
# Offset that the top and bottom 'span' text is away from the edges 
annospan=`expr $sizex / 10`

# Offset that the copyright text is from the edges.
annocopyright=`expr $sizex / 30`

# Create the 'temporary' image for the watermark.

convert -size ${sizex}x${sizey} -pointsize $fontsize -font Helvetica xc:none -fill grey \
         -gravity North -annotate 0x0+0+${annospan} "$spantext" \
         -gravity Center -annotate 0x0+0+0 "$spantext" \
         -gravity South -annotate 0x0+0+${annospan} "$spantext" \
         -gravity SouthEast -pointsize $fontsizesm -annotate \
         0x0+${annocopyright}+${annocopyright} "$copytext" \
         miff:- |\

# Do the watermarking of the image, output to itself so the file written from
# Bibble is the one that is watermarked.
 
composite -dissolve $disolve - $1 $1


Thanks! That's awesome! Got it working! I love it.
Back to top
View user's profile Send private message
afx
Bibble Expert
Bibble Expert


Joined: 21 Jul 2005
Posts: 3981
Location: Munich

PostPosted: Thu Apr 13, 2006 11:09 am    Post subject: Reply with quote

Ok,
got it finally working on windows as well. It was much easier on Linux Wink
For windows, cygwin does not work too well. I had problems with Perl, arguments would not be passed.
Instead I installed ActivePerl, manually installed Image::IPTCInfo and to get the Fonts I installed GhostScript and then I needed ImageMagick, but no computer should be without it anyway.

I use a DOS batch file to call the Perl Script:
Code:
@echo off
c:\perl\bin\perl -w c:\bin\watermark.pl %1 %2 %3


I adjusted the Perl script from Andreas a bit. I prefer embossed watermarks, they are less obtrusive. I also changed the logic a bit to avoid emtpy strings which might be an artifact from IPTC parsing.

Code:


# Author:      Andreas Schrell: as [at] schrell.de
# slightly tweaked by afx at muc.de

# Description: create watermarks in picture with optional reading of IPTC info
# Info:        put configuration in watermark.conf and locate it in home directory
# Version:     1.1 Mo. 13.03.2006 19:10:38
# Required:    perl and Image::IPTCInfo

# IPTC ATTRIBUTE REFERENCE
#         object name               originating program
#         edit status               program version
#         editorial update          object cycle
#         urgency                   by-line
#         subject reference         by-line title
#         category                  city
#         fixture identifier        sub-location
#         content location code     province/state
#         content location name     country/primary location code
#         release date              country/primary location name
#         release time              original transmission reference
#         expiration date           headline
#         expiration time           credit
#         special instructions      source
#         action advised            copyright notice
#         reference service         contact
#         reference date            caption/abstract
#         reference number          writer/editor
#         date created              image type
#         time created              image orientation
#         digital creation date     language identifier
#         digital creation time
#
#         custom1 - custom20: NOT STANDARD but used by Fotostation.
#         IPTCInfo also supports these fields.

use Image::IPTCInfo;
         
my $home;

if (defined $ENV{HOMEPATH}) { $home=$ENV{HOMEPATH}; }
if (defined $ENV{HOME}) { $home=$ENV{HOME}; }

my $settings = "c:\\$home\\watermark.conf";

our $filename = $ARGV[0];

our ($Center,@Center,$North,@North,$East,@East,$West,@West,$South,@South);
our ($NorthWest,@NorthWest,$NorthEast,@NorthEast,$SouthWest,@SouthWest,$SouthEast,@SouthEast);

our $text;
our $font;
our $fontsize;
our $textcolor;
our $undercolor;
our $off;
our $offx;
our $offy;
our $dissolve;
our $view;

### Don't think you need to edit below here unless you want to tweak.

# Determine the size of the input image..
my $sizetmp=qx/identify $filename/;
if ($sizetmp =~ /^[^ ]+ [^ ]+ ([0-9]+)x([0-9]+) /) {
   $sizex = $1;
   $sizey = $2;
} else {
   $sizex = 1000;
   $sizey = 750;
}

$off='xy';
$Center->{off} = '';
$North->{off} = 'y';
$South->{off} = 'y';
$West->{off} = 'x';
$East->{off} = 'x';


my $cmd = "convert -size ${sizex}x${sizey} xc:none ";
require "$settings";

my $zero=0;

sub setval($$$) {
   $pos = $_[0];
   $tag = $_[1];
   $def = $_[2];
   my $w;
   eval "\$w = (defined \$$pos" . "->{$tag}) ? \$$pos" . "->{$tag} : ((defined \$$tag) ? \$$tag : '$def')";
   return $w;
}

my $info = new Image::IPTCInfo("$filename");

foreach $pos ("Center","North","East","West","South","NorthEast","NorthWest","SouthEast","SouthWest") {
   $o  = setval($pos,"off","xy");
   $ax = setval($pos, (($o=~/x/) ? "offx" : "zero") ,0); $ax = int($ax);
   $ay = setval($pos, (($o=~/y/) ? "offy" : "zero") ,0); $ay = int($ay);
   $tx = setval($pos,"text","");
   $f  = setval($pos,"font","Roman");
   $fs = setval($pos,"fontsize",$sizey/50); $fs = int($fs);
#   $uc = setval($pos,"undercolor",$undercolor);
   $tc = setval($pos,"textcolor",$textcolor);
   if ($tx) {
      while ($tx =~ /\#IPTC\[([^\]]+)\]/) {
         if (defined $info) {
            my $val = $info->Attribute("$1");
            $val = (defined $val) ? $val : "";
            $tx =~ s/\#IPTC\[[^\]]+\]/$val/;
         }
      }
      if ( $tx  && $tx ne '\n' ) {
         $cmd .= "-pointsize $fs ";
         $cmd .= "-font $f ";
#         $cmd .= "-undercolor $uc ";
         $cmd .= "-fill $tc ";
         $cmd .= "-gravity $pos -annotate 0x0+$ax+$ay \"$tx\" ";
      }
   }
}


$cmd .= " -emboss 8 miff:-";

# print "$cmd\n";

system ("$cmd | composite -dissolve $dissolve - $filename $filename");

system ("$cmd > c:/hugo.text");

# Quickview for testing under Linux
if (defined $view) {
   system("$view");
}

exit 0;


Here is the matching config file

Code:
# control file for watermark.pl Script

# text

$Center->{text} = '';

# $North->{text} = '#IPTC[by-line title]';
# $South->{text} = '#IPTC[caption/abstract]';
$North->{text} = '';
$South->{text} = '';
$East->{text} = '';
$West->{text} = '';

$NorthWest->{text} = '';
$SouthWest->{text} = '© Andreas F.X. Siegert';
$NorthEast->{text} = '© Andreas F.X. Siegert';
$SouthEast->{text} = '';

# offset defaults

$offx = $sizex / 15;
$offy = $sizey / 10;

# special offsets

$SouthEast->{offx} = $sizex / 50;
$SouthEast->{offy} = $sizey / 50;

# fonts
$font = "AvantGarde-Book";
# $font = "Helvetica";

# font size
$fontsize = $sizey / 25;
# $SouthEast->{fontsize} = $sizey / 62;

# Colors
$undercolor = "black";
$textcolor = "gray";

# Dissolve (only global value)
$dissolve = 18;

# Viewer
# $view = "display -resize 1000x1000 $filename";

return 1;


Next I'll convert that to an iMatch basic script (where next probably means a looooong time)

cheers
afx

_________________
sRGB clipping sucks
Back to top
View user's profile Send private message Visit poster's website
claudermilk



Joined: 04 Nov 2005
Posts: 871

PostPosted: Fri Apr 14, 2006 6:43 am    Post subject: Reply with quote

afx wrote:

...

Next I'll convert that to an iMatch basic script (where next probably means a looooong time)

cheers
afx


Now there's the comment I've been waiting to see! Smile
Back to top
View user's profile Send private message
pekkal



Joined: 05 Mar 2006
Posts: 22

PostPosted: Fri Apr 14, 2006 12:12 pm    Post subject: Good stuff Reply with quote

This is really good stuff, and at least on Linux easy enough to set up. The only thing I could ask for is a list of possible choices for colors & fonts, or a pointer to whre these have been documented. Very Happy
_________________
Pekka L
Back to top
View user's profile Send private message Visit poster's website
afx
Bibble Expert
Bibble Expert


Joined: 21 Jul 2005
Posts: 3981
Location: Munich

PostPosted: Fri Apr 14, 2006 12:23 pm    Post subject: Reply with quote

Check out the ImageMagick docs...
It is a very versatile toolkit.

I meanwhile added a bit of USM to my version as I run the script on reduced size images:
-unsharp 3x1+0.7
on the composite commandline.

cheers
afx

_________________
sRGB clipping sucks
Back to top
View user's profile Send private message Visit poster's website
pekkal



Joined: 05 Mar 2006
Posts: 22

PostPosted: Sun Apr 23, 2006 10:04 am    Post subject: Watermark not working after upgrade to 4.7a Reply with quote

I just noticed that my batch no longer adds the watermark. The only change I can think of is from Bibble Pro 4.7 to 4.7a.

Does anybody else have the same issue, or any thougths what could be wrong?

25.4: reinstalling the 'watermark' file solved the problem. Laughing

_________________
Pekka L


Last edited by pekkal on Tue Apr 25, 2006 10:01 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
TonyKInTexas



Joined: 14 Oct 2004
Posts: 271

PostPosted: Mon Apr 24, 2006 5:58 pm    Post subject: Reply with quote

An issue I see is one of fonts used for the watermark. Not everyone will want Times or Arial type fonts. Smile
Back to top
View user's profile Send private message
cogitech



Joined: 26 Feb 2005
Posts: 173

PostPosted: Thu Apr 27, 2006 5:33 pm    Post subject: Reply with quote

afx wrote:
Check out the ImageMagick docs...
It is a very versatile toolkit.

I meanwhile added a bit of USM to my version as I run the script on reduced size images:
-unsharp 3x1+0.7
on the composite commandline.

cheers
afx


Sweeet! I gotta try this!
Back to top
View user's profile Send private message
cogitech



Joined: 26 Feb 2005
Posts: 173

PostPosted: Thu Apr 27, 2006 5:43 pm    Post subject: Reply with quote

cogitech wrote:
afx wrote:
Check out the ImageMagick docs...
It is a very versatile toolkit.

I meanwhile added a bit of USM to my version as I run the script on reduced size images:
-unsharp 3x1+0.7
on the composite commandline.

cheers
afx


Sweeet! I gotta try this!


Now *that*, my friends, just made my week!

Perfect!

Thanks, afx!!! Very Happy


Now if only I could get this script to run on my web galleries...
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    support.bibblelabs.com Forum Index -> Bibble Pro - General Discussion All times are GMT - 8 Hours
Goto page Previous  1, 2, 3, 4, 5  Next
Page 4 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group