Sepia tone task for Nikolaus

14 views
Skip to first unread message

Mark Pazolli

unread,
May 28, 2007, 9:43:15 PM5/28/07
to seasho...@googlegroups.com, nikolaus pi
Hey Nikolaus,

This first task will familiarize you with SVN and how Seashore works
with pixels.

It may also be included in the final release.

If you build and open the latest version of Seashore and run "Effects
> Colour > Sepia". You will see the plug-in works but inverts the
image, not converts it to sepia.

According to http://en.wikipedia.org/wiki/Sepia_tone, Microsoft gives
the following code for sepia tone:

R' = (R × 0.393 + G × 0.769 + B × 0.189) / 1.351;
G' = (R × 0.349 + G × 0.686 + B × 0.168) / 1.203;
B' = (R × 0.272 + G × 0.534 + B × 0.131) / 2.140;

The task is to implement sepia tone plug-in (see Plug-ins/Sepia/
Sepia.xcode). In Seashore, pixel values are between 0 and 255. In the
above code, pixel values are between 0.0 and 1.0. You can covert
between the two by multiplying or dividing by 255.

If you want you can implement the code converting to and form
floating-point values. It may be worth doing this first and
committing the working code to the SVN. However ultimately the aim
will be to do this all integer operations. To do this you will need
the following macro:

/*!
@defined int_mult(a, b, t)
@discussion A macro that when given two unsigned characters (bytes)
determines the product of the two. The returned value is scaled
so it is between 0 and 255. A third argument, a temporary
integer, must also be passed to allow the calculation to
complete.
*/
#define int_mult(a,b,t) ((t) = (a) * (b) + 0x80, ((((t) >> 8) + (t))
>> 8))

And possibly the MAX macro. Good luck and, if you have trouble, focus
on the floating-point version first.

Mark.

Mark

unread,
Jun 1, 2007, 10:42:11 PM6/1/07
to Seashore Developers, n....@gmx.at
Nikolaus,

If you're having any trouble with the Sepia task, please don't
hesistate to post to the group.

Mark.

Mark Pazolli

unread,
Jun 2, 2007, 10:50:01 AM6/2/07
to nikolaus pi, seasho...@googlegroups.com
Hi nikolaus,

I think you might find the compilation problem is solved by setting a
customised build location. From the "Source Code Read Me":

> Building Seashore requires Xcode 2.2 or later on Mac OS 10.4 or
> later. Seashore is a Universal build, and will run on any Macintosh
> computer running Mac OS 10.3.9 or later.
>
> It is also strongly recommended that you have a common, Customized
> Location for your Build Products. This location may be anywhere on
> your disk. You can set this preference in Xcode by choosing Xcode >
> Preferences > Building > Place Build Product in: > Customized
> location:, and clicking on the Choose... button.

Another trick you might find useful is if you want to return to the
SVN version of a file, just throw it in the trash and then "cd ~; svn
update" again (I think that should work).

Also the point of that Sepia plug-in was not to use Core Image. Core
Image is useful, but it only works for some users (e.g. Mac OS 10.4
users). That's why we need a sepia effect that does not use Core
Image so every Mac user can apply the sepia effect. So at least for
the Sepia plug-in _please don't use Core Image_. There will be
another Sepia+ plug-in that uses Core Image.

Mark.

On 02/06/2007, at 8:04 PM, nikolaus pi wrote:

> Hi Mark,
>
> attached to thi email you will find the first translation for
> seashore in german. (In most cases i use the gimp translation from
> english to german, but i'll work over the translation again to be
> perfekt for the 1.0, because some thinks are tricky to explain right.)
>
> I start now to make the sepia tone, i have found some good stuff on
> the Internet how to use the CoreImage CISepiaTone.
>
> So far i the only problem i got, is to compile the seashore-source
> right. i always get these err-messages when i try to compile:
> (see attached err_message.png)
> and when i set the path for the gimp framework new, xcode is
> missing some *.h file(s).
>
> so lang and thanks for your answers
>
> nikolaus
>
>
>
>
> -------- Original-Nachricht --------
> Datum: Fri, 01 Jun 2007 19:42:11 -0700
> Von: Mark <ced...@gmail.com>
> An: Seashore Developers <seasho...@googlegroups.com>
> CC: n....@gmx.at
> Betreff: Re: Sepia tone task for Nikolaus

> --
> Psssst! Schon vom neuen GMX MultiMessenger gehört?
> Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
> <German.lproj.zip>
> <err_message.png>

Mark

unread,
Jun 28, 2007, 11:40:50 PM6/28/07
to Seashore Developers, n....@gmx.at
Hi Nikolaus,

If you are still interested in completing this task, please post to
this thread as soon as possible.

I need the sepia plug-ins implemented very soon (probably by next
week).

Mark.

Reply all
Reply to author
Forward
0 new messages