MCPcopy Index your code
hub / github.com/plotly/plotly.py / __init__

Method __init__

_plotly_utils/png.py:361–624  ·  view source on GitHub ↗

Create a PNG encoder object. Arguments: width, height Image size in pixels, as two separate arguments. size Image size (w,h) in pixels, as single argument. greyscale Pixels are greyscale, not RGB. alpha Input

(
        self,
        width=None,
        height=None,
        size=None,
        greyscale=Default,
        alpha=False,
        bitdepth=8,
        palette=None,
        transparent=None,
        background=None,
        gamma=None,
        compression=None,
        interlace=False,
        planes=None,
        colormap=None,
        maxval=None,
        chunk_limit=2**20,
        x_pixels_per_unit=None,
        y_pixels_per_unit=None,
        unit_is_meter=False,
    )

Source from the content-addressed store, hash-verified

359 """
360
361 def __init__(
362 self,
363 width=None,
364 height=None,
365 size=None,
366 greyscale=Default,
367 alpha=False,
368 bitdepth=8,
369 palette=None,
370 transparent=None,
371 background=None,
372 gamma=None,
373 compression=None,
374 interlace=False,
375 planes=None,
376 colormap=None,
377 maxval=None,
378 chunk_limit=2**20,
379 x_pixels_per_unit=None,
380 y_pixels_per_unit=None,
381 unit_is_meter=False,
382 ):
383 """
384 Create a PNG encoder object.
385
386 Arguments:
387
388 width, height
389 Image size in pixels, as two separate arguments.
390 size
391 Image size (w,h) in pixels, as single argument.
392 greyscale
393 Pixels are greyscale, not RGB.
394 alpha
395 Input data has alpha channel (RGBA or LA).
396 bitdepth
397 Bit depth: from 1 to 16 (for each channel).
398 palette
399 Create a palette for a colour mapped image (colour type 3).
400 transparent
401 Specify a transparent colour (create a ``tRNS`` chunk).
402 background
403 Specify a default background colour (create a ``bKGD`` chunk).
404 gamma
405 Specify a gamma value (create a ``gAMA`` chunk).
406 compression
407 zlib compression level: 0 (none) to 9 (more compressed);
408 default: -1 or None.
409 interlace
410 Create an interlaced image.
411 chunk_limit
412 Write multiple ``IDAT`` chunks to save memory.
413 x_pixels_per_unit
414 Number of pixels a unit along the x axis (write a
415 `pHYs` chunk).
416 y_pixels_per_unit
417 Number of pixels a unit along the y axis (write a
418 `pHYs` chunk). Along with `x_pixel_unit`, this gives

Callers

nothing calls this directly

Calls 7

check_sizesFunction · 0.85
is_naturalFunction · 0.85
ProtocolErrorClass · 0.85
check_paletteFunction · 0.85
check_bitdepth_rescaleFunction · 0.85
check_colorFunction · 0.85
intFunction · 0.85

Tested by

no test coverage detected