Metadata-Version: 2.1
Name: Keyimstr
Version: 0.0.1
Summary: Numpy <-> Bytes <-> String
Home-page: https://github.com/keywind127/image-string-converter
Author: Keywind
Author-email: watersprayer127@gmail.com
Project-URL: Bug Tracker, https://github.com/keywind127/image-string-converter/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# Keyimstr Documentation
##### [ 1 ] ImageConverter.numpy2bytes(numpy_image, \*args, \*\*kwargs) -> bytes
|parameter|data type|default value|
|-|-|-|
|numpy_image|numpy.ndarray|-|
|encoding|str|".jpg"|

    # example 1
    from keyimstr import ImageConverter
    import numpy

    image = numpy.zeros(shape = (25, 25, 3), dtype = numpy.uint8)
    print(type(image))

    byte = ImageConverter.numpy2bytes(image)
    print(type(byte))

##### [ 2 ] ImageConverter.bytes2string(byte_image, \*args, \*\*kwargs) -> str

|parameter|data type|default value|
|-|-|-|
|byte_image|bytes|-|
|encoding|str|"ascii"|

    # example 2
    from keyimstr import ImageConverter
    import numpy

    image = numpy.zeros(shape = (25, 25, 3), dtype = numpy.uint8)
    print(type(image))

    byte = ImageConverter.numpy2bytes(image)
    print(type(byte))

    string = ImageConverter.bytes2string(byte)
    print(type(string))

##### [ 3 ] ImageConverter.string2bytes(string_image) -> bytes

|parameter|data type|default value|
|-|-|-|
|string_image|str|-|

    # example 3
    from keyimstr import ImageConverter
    import numpy

    image = numpy.zeros(shape = (25, 25, 3), dtype = numpy.uint8)
    print(type(image))

    byte = ImageConverter.numpy2bytes(image)
    print(type(byte))

    string = ImageConverter.bytes2string(byte)
    print(type(string))

    byte = ImageConverter.string2bytes(string)
    print(type(byte))

##### [ 4 ] ImageConverter.bytes2numpy(byte_image, \*args, \*\*kwargs) -> numpy.ndarray

|parameter|data type|default value|
|-|-|-|
|byte_image|bytes|-|
|np_encoding|int|numpy.uint8|
|cv_encoding|int|cv2.IMREAD_COLOR|

    # example 4
    from keyimstr import ImageConverter
    import numpy

    image = numpy.zeros(shape = (25, 25, 3), dtype = numpy.uint8)
    print(type(image))

    byte = ImageConverter.numpy2bytes(image)
    print(type(byte))

    string = ImageConverter.bytes2string(byte)
    print(type(string))

    byte = ImageConverter.string2bytes(string)
    print(type(byte))

    image = ImageConverter.bytes2numpy(byte)
    print(type(image))
