# Sabattier effect in processing

**URL:** <https://discourse.processing.org/t/sabattier-effect-in-processing/21553>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [June 4, 2020, 11:55am UTC](https://discourse.processing.org/t/sabattier-effect-in-processing/21553 "2020-06-04T11:55:02Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![gatz\_gaz](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@gatz\_gaz](https://discourse.processing.org/u/gatz_gaz)\
**Post date:** [June 4, 2020, 3:04pm UTC](https://discourse.processing.org/t/sabattier-effect-in-processing/21553/7 "2020-06-04T15:04:30Z")

</div>

> [@uheinema](#):
>
> ```auto
> 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);
> }
> 
> ```

of course, thank you very much!!

---

_[View the full topic](https://discourse.processing.org/t/sabattier-effect-in-processing/21553)._
