Sabattier effect in processing

please format code with </> button * homework policy * asking questions

Hi, does anyone know how to do the Sabattier effect in processing?

Example:
2300869305_73b69bf475

2 Likes
  1. Find out what the effect is. Hint: Gradients
  2. Get the pixels
  3. Apply your sabbatier() function
  4. Update the pixels
  5. Display

If you need speed, do it in a GLSL shader.

1 Like

Try to look at how it’s actually implemented in image editing softwares for example :

1 Like

Of course Man Ray did a little selective overexposure…the bluish brightening is my weak attempt of mimicing that.
Sketch i just wrote shows
Screenshot_20200604_163748_com.calsignlabs.apde.sketchpreview
.
Source on request, but try yuor own first

That’s what I’m talking about, could I have the code to rehearse, please?

Ah well…make it better, and share.


PImage pic, sab;

float aspect;
float piwi;

void setup() {
  fullScreen();
  pic=loadImage(
    "manray.png"
    // "face.png"
    //"athene.jpg"
    );
  piwi=width;
  aspect=1.0*pic.height/pic.width;
  if (aspect>1) piwi/=aspect;
  sab=pic.get();
  sab.loadPixels();
  sabbatier(sab.pixels);
  sab.updatePixels();
}

void sabbatier(int[] pixels) {
  for (int i=0; i<pixels.length; i++) {
    int c=pixels[i];
    float blue=(c&0xff)/255.0f;
    pixels[i]=color(255*sabbatier(blue));
  }
}

float sabbatier(float u) {
  final float lim=0.2f;
  float r;
  if (u<lim)
    r=map(u, 0, lim, 1, 0);
  else
    r=map(u, lim, 1, 0, 1);
  return r;
}

void draw() {
  background(frameCount);
  image(pic, 0, 10, piwi, piwi*aspect);
  image(sab, 0, 20+piwi*aspect, piwi, piwi*aspect);
}

2 Likes

of course, thank you very much!!

1 Like

If the Sabattier effect is worth encapsulating as a configurable effect, it might be worth proposing to @Milchreis as an addition for this library:

2 Likes

Very good idea Jeremy. I created a ticket for that :slight_smile:

2 Likes

And in case you really want to know, in depth explanations are at

Somewhat contradictory:

This process was identified by Armand Sabbatier in 1860, involving partial solarization of high contrast prints, during the development process.

Sabatier (often misspelled Sabattier) was a doctor of medicine in the small French village of Saint-Mammers. He has been regularly confused with Armand Sabatier, a marine zoologist of the era, who published nothing on photography.

And also wiith Paul, Sabatier, Nobel Pricre for Chemistry 1912…but he wss born in 1857

The effect was first described in print by H. de la Blanchere in 1859 in L’Art du Photographe. It was described again in 1860 by L.M. Rutherford and C.A. Seely, separately, in successive issues of The American Journal of Photography, and in the same year by Count Schouwaloff in the French publication Cosmos. By rights the phenomenon should have been christened the Blanchere Effect, for it was not described by Sabatier until later in 1860 in Cosmos. Sabatier must have been aware of Schouwaloff’s earlier paper in the same publication, but he makes no mention of it.

So now we know…

3 Likes