Custom Texture ---> hatch_scale?

Hi,

Wondering if there’s a way to control the hatch_scale of a custom texture (instantiated using ImageURLTexture as suggested in the docs). Super powerful possibilities with this feature btw :slight_smile:

Minimized example:

from bokeh.models import Rect, ImageURLTexture, ColumnDataSource
from bokeh.plotting import figure,show

f = figure()

src = ColumnDataSource(data={‘x’:[1],‘y’:[1],‘w’:[1],‘h’:[1],‘texture’:[‘sand’]})
glyph = Rect(x=‘x’,y=‘y’,width=‘w’,height=‘h’,hatch_extra= {‘sand’:ImageURLTexture(url=‘https://www.myfreetextures.com/wp-content/uploads/2011/08/2011-06-11-09495.jpg’,repetition='repeat’)}
,hatch_pattern=‘texture’
,hatch_scale=0.1 #THIS DOESN’T SEEM DO ANYTHING
)
rend = f.add_glyph(src,glyph)
show(f)

Thank you!

Gaelen

Most of the hatch options are ignored for image textures because they just don’t really apply (e.g. what would hatch_color do? The image specifies its own colors) and this includes hatch_scale

Since almost all the canvas rendering in Bokeh synchronous except image-based things, it seems like it might add a fair amount of complication to try and have hatch_scale do anything for images. If someone wants to work on this and has a coherent user story/set of requirements, I would be willing to try to offer any relevant guidance.

1 Like

I essentially hoped that given the texture is “repeating”, I could use the hatch_scale to scale down the size of each pixel in the image (with no added “cost” because it’d simply repeat itself more)… so this grate/mesh in my example would appear much finer (in the case of a hatch_scale<1) or coarser (>1).

Right I do think hatch_scale could be interpreted as a plain pixel scaling. But I also think the “differentness” inherent to image handling will make it not quite as trivial to implement as it would be otherwise. Certainly a reasonable GitHub Issue to submit, I just can’t speculate when it might actually get worked on.