Bokeh & HTML5 Anti Aliasing / forcing nearest neighbors interploation

Hi,

I have noticed that on certain browsers/ (not retina
display) monitors that there is a noticeable anti-aliasing effect taking place at
different levels of chart zoom.

My goal is to be able to plot single pixel
lines without shadow/smoothing.

I cant find anything in the Bokeh documentation
regarding this, so I spent some time reading about how Bokeh creates a canvas
object – which has a known anti-aliasing issue. I found this stack overflow
thread which discusses it: http://stackoverflow.com/questions/7615009/disable-interpolation-when-scaling-a-canvas

From stack overflow it seems that the cleanest solution is to add:

“The most cross-platform, CSS-only solution
so far is thus:

canvas {
  image-rendering: optimizeSpeed;             /* Older versions of FF          */
  image-rendering: -moz-crisp-edges;          /* FF 6.0+                       */
  image-rendering: -webkit-optimize-contrast; /* Safari                        */
  image-rendering: -o-crisp-edges;            /* OS X & Windows Opera (12.02+) */
  image-rendering: pixelated;                 /* Awesome future-browsers       */
  -ms-interpolation-mode: nearest-neighbor;   /* IE                            */
}

“

Unfortunately web development is not one of my strengths and
there does not seem to be an obvious way to add this to the Bokeh css file. Would
anyone be able to point me in the right direction so that I can explicitly set the image-rendering properties?

Thank you so much,

Matt

I believe this is fixed
in dev builds and will be available in the upcoming 0.12
release.

···

On 6/17/16 7:53 AM,
wrote:

[email protected]

Hi,

      I have noticed that on certain browsers/

(not retina
display) monitors that there is a noticeable anti-aliasing
effect taking place at
different levels of chart zoom.

      My goal is to be able to plot single pixel

lines without shadow/smoothing.

      I cant find anything in the Bokeh

documentation
regarding this, so I spent some time reading about how Bokeh
creates a canvas
object – which has a known anti-aliasing issue. I found this
stack overflow
thread which discusses it: http://stackoverflow.com/questions/7615009/disable-interpolation-when-scaling-a-canvas

      From stack overflow it seems that the

cleanest solution is to add:

“ The
most cross-platform, CSS-only solution
so far is thus:

canvas {
  image-rendering: optimizeSpeed;             /* Older versions of FF          */
  image-rendering: -moz-crisp-edges;          /* FF 6.0+                       */
  image-rendering: -webkit-optimize-contrast; /* Safari                        */
  image-rendering: -o-crisp-edges;            /* OS X & Windows Opera (12.02+) */
  image-rendering: pixelated;                 /* Awesome future-browsers       */
  -ms-interpolation-mode: nearest-neighbor;   /* IE                            */
}

      Unfortunately web development is not one of

my strengths and
there does not seem to be an obvious way to add this to the
Bokeh css file. Would
anyone be able to point me in the right direction so that I
can explicitly set the image-rendering properties?

Thank you so much,

Matt

  You received this message because you are subscribed to the Google

Groups “Bokeh Discussion - Public” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to [email protected].

  To post to this group, send email to [email protected]

  To view this discussion on the web visit [](https://groups.google.com/a/continuum.io/d/msgid/bokeh/1d3fde11-35b9-41b1-8cb9-acd16462bcc2%40continuum.io?utm_medium=email&utm_source=footer)      .

For more options, visit .


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

https://groups.google.com/a/continuum.io/d/msgid/bokeh/1d3fde11-35b9-41b1-8cb9-acd16462bcc2%40continuum.io
https://groups.google.com/a/continuum.io/d/optout

Great to hear thanks. Any idea when 0.12 is scheduled for release? Is it possible to download a dev build off with this feature anywhere?

···

On Friday, June 17, 2016 at 11:04:04 PM UTC-3, Sarah Bird wrote:

I believe this is fixed
in dev builds and will be available in the upcoming 0.12
release.

  On 6/17/16 7:53 AM, > [email protected] wrote:

Hi,

      I have noticed that on certain browsers/

(not retina
display) monitors that there is a noticeable anti-aliasing
effect taking place at
different levels of chart zoom.

      My goal is to be able to plot single pixel

lines without shadow/smoothing.

      I cant find anything in the Bokeh

documentation
regarding this, so I spent some time reading about how Bokeh
creates a canvas
object – which has a known anti-aliasing issue. I found this
stack overflow
thread which discusses it: http://stackoverflow.com/questions/7615009/disable-interpolation-when-scaling-a-canvas

      From stack overflow it seems that the

cleanest solution is to add:

“ The
most cross-platform, CSS-only solution
so far is thus:

canvas {
  image-rendering: optimizeSpeed;             /* Older versions of FF          */
  image-rendering: -moz-crisp-edges;          /* FF 6.0+                       */
  image-rendering: -webkit-optimize-contrast; /* Safari                        */
  image-rendering: -o-crisp-edges;            /* OS X & Windows Opera (12.02+) */
  image-rendering: pixelated;                 /* Awesome future-browsers       */
  -ms-interpolation-mode: nearest-neighbor;   /* IE                            */
}

      Unfortunately web development is not one of

my strengths and
there does not seem to be an obvious way to add this to the
Bokeh css file. Would
anyone be able to point me in the right direction so that I
can explicitly set the image-rendering properties?

Thank you so much,

Matt

  You received this message because you are subscribed to the Google

Groups “Bokeh Discussion - Public” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to [email protected].

  To post to this group, send email to [email protected]

  To view this discussion on the web visit [](https://groups.google.com/a/continuum.io/d/msgid/bokeh/1d3fde11-35b9-41b1-8cb9-acd16462bcc2%40continuum.io?utm_medium=email&utm_source=footer)[https://groups.google.com/a/continuum.io/d/msgid/bokeh/1d3fde11-35b9-41b1-8cb9-acd16462bcc2%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/1d3fde11-35b9-41b1-8cb9-acd16462bcc2%40continuum.io).

  For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).


Sarah Bird
Developer, Bokeh

    [
      <img alt="Continuum Analytics" src="https://lh6.googleusercontent.com/proxy/VYgVjggTk1hCXSN9wFkffE3I6kxTvJ51tT4KvDXOuKbs1WyFG66k7kt2-vkDimbyxfWtP-d1paJmstMYhPPnDYSUF4rLPoYM2GM2QFM=w5000-h5000" height="30px" width="150px">
    ](http://continuum.io)

I'm not sure the recent changes were the same as these, so checking out a dev build would be helpful:

  http://bokeh.pydata.org/en/0.11.1/docs/installation.html#developer-builds

Bryan

···

On Jun 17, 2016, at 9:40 PM, Matt K <[email protected]> wrote:

Great to hear thanks. Any idea when 0.12 is scheduled for release? Is it possible to download a dev build off with this feature anywhere?

On Friday, June 17, 2016 at 11:04:04 PM UTC-3, Sarah Bird wrote:
I believe this is fixed in dev builds and will be available in the upcoming 0.12 release.

On 6/17/16 7:53 AM, [email protected] wrote:

Hi,

I have noticed that on certain browsers/ (not retina display) monitors that there is a noticeable anti-aliasing effect taking place at different levels of chart zoom.

My goal is to be able to plot single pixel lines without shadow/smoothing.

I cant find anything in the Bokeh documentation regarding this, so I spent some time reading about how Bokeh creates a canvas object – which has a known anti-aliasing issue. I found this stack overflow thread which discusses it: http://stackoverflow.com/questions/7615009/disable-interpolation-when-scaling-a-canvas

From stack overflow it seems that the cleanest solution is to add:

“The most cross-platform, CSS-only solution so far is thus:

canvas {
  image-rendering: optimizeSpeed; /* Older versions of FF */
  image-rendering: -moz-crisp-edges; /* FF 6.0+ */
  image-rendering: -webkit-optimize-contrast; /* Safari */
  image-rendering: -o-crisp-edges; /* OS X & Windows Opera (12.02+) */
  image-rendering: pixelated; /* Awesome future-browsers */
  -ms-interpolation-mode: nearest-neighbor; /* IE */
}

Unfortunately web development is not one of my strengths and there does not seem to be an obvious way to add this to the Bokeh css file. Would anyone be able to point me in the right direction so that I can explicitly set the image-rendering properties?

Thank you so much,

Matt

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/1d3fde11-35b9-41b1-8cb9-acd16462bcc2%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
Sarah Bird
Developer, Bokeh

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c59d84e9-8b47-4c00-b564-35b83f5bc881%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Ok, any chance you could point me to the issue on github so that I can see how it was addressed? I couldnt find anything after a quick search.

···

On Friday, June 17, 2016 at 11:44:50 PM UTC-3, Bryan Van de ven wrote:

I’m not sure the recent changes were the same as these, so checking out a dev build would be helpful:

    [http://bokeh.pydata.org/en/0.11.1/docs/installation.html#developer-builds](http://bokeh.pydata.org/en/0.11.1/docs/installation.html#developer-builds)

Bryan

On Jun 17, 2016, at 9:40 PM, Matt K [email protected] wrote:

Great to hear thanks. Any idea when 0.12 is scheduled for release? Is it possible to download a dev build off with this feature anywhere?

On Friday, June 17, 2016 at 11:04:04 PM UTC-3, Sarah Bird wrote:

I believe this is fixed in dev builds and will be available in the upcoming 0.12 release.

On 6/17/16 7:53 AM, [email protected] wrote:

Hi,

I have noticed that on certain browsers/ (not retina display) monitors that there is a noticeable anti-aliasing effect taking place at different levels of chart zoom.

My goal is to be able to plot single pixel lines without shadow/smoothing.

I cant find anything in the Bokeh documentation regarding this, so I spent some time reading about how Bokeh creates a canvas object – which has a known anti-aliasing issue. I found this stack overflow thread which discusses it: http://stackoverflow.com/questions/7615009/disable-interpolation-when-scaling-a-canvas

From stack overflow it seems that the cleanest solution is to add:

“The most cross-platform, CSS-only solution so far is thus:

canvas {

image-rendering: optimizeSpeed; /* Older versions of FF */

image-rendering: -moz-crisp-edges; /* FF 6.0+ */

image-rendering: -webkit-optimize-contrast; /* Safari */

image-rendering: -o-crisp-edges; /* OS X & Windows Opera (12.02+) */

image-rendering: pixelated; /* Awesome future-browsers */

-ms-interpolation-mode: nearest-neighbor; /* IE */

}

Unfortunately web development is not one of my strengths and there does not seem to be an obvious way to add this to the Bokeh css file. Would anyone be able to point me in the right direction so that I can explicitly set the image-rendering properties?

Thank you so much,

Matt


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/1d3fde11-35b9-41b1-8cb9-acd16462bcc2%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.


Sarah Bird

Developer, Bokeh


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c59d84e9-8b47-4c00-b564-35b83f5bc881%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

There's been alot of churn in this release cycle. There were a few PRs but AFAIK they all related to WebGL + HiDPI. You can see them in this list.

  https://github.com/bokeh/bokeh/pulls?q=is%3Apr+is%3Aclosed+author%3Aalmarklein+label%3A"status%3A+accepted"

That said, the quickest thing is probably to just try the latest dev build and see if it fixes what you are seeing or not. If not, I'd suggest a GH issue with as much information as possible, screenshots, etc. It's almost certainly too late for 0.12 (we are overdue for our freeze already), but perhaps a 0.12.1 follow on.

Bryan

···

On Jun 17, 2016, at 9:47 PM, Matt K <[email protected]> wrote:

Ok, any chance you could point me to the issue on github so that I can see how it was addressed? I couldnt find anything after a quick search.

On Friday, June 17, 2016 at 11:44:50 PM UTC-3, Bryan Van de ven wrote:
I'm not sure the recent changes were the same as these, so checking out a dev build would be helpful:

        http://bokeh.pydata.org/en/0.11.1/docs/installation.html#developer-builds

Bryan

> On Jun 17, 2016, at 9:40 PM, Matt K <[email protected]> wrote:
>
> Great to hear thanks. Any idea when 0.12 is scheduled for release? Is it possible to download a dev build off with this feature anywhere?
>
> On Friday, June 17, 2016 at 11:04:04 PM UTC-3, Sarah Bird wrote:
> I believe this is fixed in dev builds and will be available in the upcoming 0.12 release.
>
> On 6/17/16 7:53 AM, [email protected] wrote:
>> Hi,
>>
>> I have noticed that on certain browsers/ (not retina display) monitors that there is a noticeable anti-aliasing effect taking place at different levels of chart zoom.
>>
>>
>> My goal is to be able to plot single pixel lines without shadow/smoothing.
>>
>>
>> I cant find anything in the Bokeh documentation regarding this, so I spent some time reading about how Bokeh creates a canvas object – which has a known anti-aliasing issue. I found this stack overflow thread which discusses it: http://stackoverflow.com/questions/7615009/disable-interpolation-when-scaling-a-canvas
>>
>>
>> From stack overflow it seems that the cleanest solution is to add:
>>
>>
>> “The most cross-platform, CSS-only solution so far is thus:
>>
>> canvas {
>> image-rendering: optimizeSpeed; /* Older versions of FF */
>> image-rendering: -moz-crisp-edges; /* FF 6.0+ */
>> image-rendering: -webkit-optimize-contrast; /* Safari */
>> image-rendering: -o-crisp-edges; /* OS X & Windows Opera (12.02+) */
>> image-rendering: pixelated; /* Awesome future-browsers */
>> -ms-interpolation-mode: nearest-neighbor; /* IE */
>> }
>> “
>>
>> Unfortunately web development is not one of my strengths and there does not seem to be an obvious way to add this to the Bokeh css file. Would anyone be able to point me in the right direction so that I can explicitly set the image-rendering properties?
>>
>>
>> Thank you so much,
>>
>>
>> Matt
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
>> To post to this group, send email to [email protected].
>> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/1d3fde11-35b9-41b1-8cb9-acd16462bcc2%40continuum.io.
>> For more options, visit https://groups.google.com/a/continuum.io/d/optout.
>
> --
> Sarah Bird
> Developer, Bokeh
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c59d84e9-8b47-4c00-b564-35b83f5bc881%40continuum.io.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/cc17a097-e370-46a5-bd39-fd5e9d65c177%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks Bryan,

I managed to get the affect I wanted by setting my own anti aliasing value in the webGL line implementation.

Do you know if its possible to create a webGL line with breaks? Or if there is a way to run “multiple lines” with a webGL line? Following the instructions for a regular line glyph seems to default back to a canvas line.

Thanks,

Matt

···

On Friday, June 17, 2016 at 11:55:35 PM UTC-3, Bryan Van de ven wrote:

There’s been alot of churn in this release cycle. There were a few PRs but AFAIK they all related to WebGL + HiDPI. You can see them in this list.

    [https://github.com/bokeh/bokeh/pulls?q=is%3Apr+is%3Aclosed+author%3Aalmarklein+label%3A%22status%3A+accepted%22](https://github.com/bokeh/bokeh/pulls?q=is%3Apr+is%3Aclosed+author%3Aalmarklein+label%3A%22status%3A+accepted%22)

That said, the quickest thing is probably to just try the latest dev build and see if it fixes what you are seeing or not. If not, I’d suggest a GH issue with as much information as possible, screenshots, etc. It’s almost certainly too late for 0.12 (we are overdue for our freeze already), but perhaps a 0.12.1 follow on.

Bryan

On Jun 17, 2016, at 9:47 PM, Matt K [email protected] wrote:

Ok, any chance you could point me to the issue on github so that I can see how it was addressed? I couldnt find anything after a quick search.

On Friday, June 17, 2016 at 11:44:50 PM UTC-3, Bryan Van de ven wrote:

I’m not sure the recent changes were the same as these, so checking out a dev build would be helpful:

    [http://bokeh.pydata.org/en/0.11.1/docs/installation.html#developer-builds](http://bokeh.pydata.org/en/0.11.1/docs/installation.html#developer-builds)

Bryan

On Jun 17, 2016, at 9:40 PM, Matt K [email protected] wrote:

Great to hear thanks. Any idea when 0.12 is scheduled for release? Is it possible to download a dev build off with this feature anywhere?

On Friday, June 17, 2016 at 11:04:04 PM UTC-3, Sarah Bird wrote:
I believe this is fixed in dev builds and will be available in the upcoming 0.12 release.

On 6/17/16 7:53 AM, [email protected] wrote:

Hi,

I have noticed that on certain browsers/ (not retina display) monitors that there is a noticeable anti-aliasing effect taking place at different levels of chart zoom.

My goal is to be able to plot single pixel lines without shadow/smoothing.

I cant find anything in the Bokeh documentation regarding this, so I spent some time reading about how Bokeh creates a canvas object – which has a known anti-aliasing issue. I found this stack overflow thread which discusses it: http://stackoverflow.com/questions/7615009/disable-interpolation-when-scaling-a-canvas

From stack overflow it seems that the cleanest solution is to add:

“The most cross-platform, CSS-only solution so far is thus:

canvas {
image-rendering: optimizeSpeed; /* Older versions of FF /
image-rendering: -moz-crisp-edges; /
FF 6.0+ /
image-rendering: -webkit-optimize-contrast; /
Safari /
image-rendering: -o-crisp-edges; /
OS X & Windows Opera (12.02+) /
image-rendering: pixelated; /
Awesome future-browsers /
-ms-interpolation-mode: nearest-neighbor; /
IE */
}

Unfortunately web development is not one of my strengths and there does not seem to be an obvious way to add this to the Bokeh css file. Would anyone be able to point me in the right direction so that I can explicitly set the image-rendering properties?

Thank you so much,

Matt


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/1d3fde11-35b9-41b1-8cb9-acd16462bcc2%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.


Sarah Bird
Developer, Bokeh


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c59d84e9-8b47-4c00-b564-35b83f5bc881%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/cc17a097-e370-46a5-bd39-fd5e9d65c177%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.