OUDON / rmqrcode-python

Rectangular Micro QR Code (rMQR Code) Generator in Python
https://pypi.org/project/rmqrcode/
Other
158 stars 16 forks source link

add `get_ndarray` #12

Closed Ar-Ray-code closed 2 years ago

Ar-Ray-code commented 2 years ago

Thank you for the great repository. :smile:

I propose a modification to convert to np.ndarray, as the process of creating the program required compositing with other images.

Use get_ndarray() to convert for OpenCV.

 ...
    image = QRImage(qr, module_size=8)

    if USE_NUMPY:
        import cv2
        img = image.get_ndarray()
        cv2.imshow("img", img)
        cv2.waitKey(0)
        cv2.destroyAllWindows()

As this is a very simple change, no changes are made to the Requirements.

OUDON commented 2 years ago

@Ar-Ray-code Thank you for your contribution! Looks good to add the option use numpy. This feature will be in the next release.

OUDON commented 2 years ago

This is released in the version 0.2.0.