MCPcopy Create free account
hub / github.com/OpenBMB/MiniCPM-V / posterize_func

Function posterize_func

omnilmm/model/utils.py:260–265  ·  view source on GitHub ↗

same output as PIL.ImageOps.posterize

(img, bits)

Source from the content-addressed store, hash-verified

258
259
260def posterize_func(img, bits):
261 '''
262 same output as PIL.ImageOps.posterize
263 '''
264 out = np.bitwise_and(img, np.uint8(255 << (8 - bits)))
265 return out
266
267
268def shear_y_func(img, factor, fill=(0, 0, 0)):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected