RGB 8x8x8: Node-rec-contrib-image-tools ... How to?

I use the node-rec-contrib-image-tools, with JIMP... which is great :wink: but I have a small "jam"...
Can you help me please?

I generate a QR Code with the node, and later I resize it (because I have to present it with a certain resolution)...and I record it with .bmp extension
Up to this point no problem...

I have the problem, because that resulting image is not RGB 8x8x8 = 24bits and it is the quality that I need at the output.

How can I do to convert the image to RGB 24 bits with this Node?
I tried several options and I can't get it :frowning:

First thing to do would be to create a small flow demomstraiting your issue and then export it and attach it to a reply.

Attached the Flow...

    {
        "id": "e027feedd4008f4b",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "075e256aa6476620",
        "type": "change",
        "z": "e027feedd4008f4b",
        "name": "BN",
        "rules": [
            {
                "t": "set",
                "p": "options",
                "pt": "msg",
                "to": "{\"barcolor\":\"000000\",\"backgroundcolor\":\"ffffff\",\"showborder\":false,\"padding\":2}",
                "tot": "json"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 330,
        "y": 200,
        "wires": [
            [
                "b413d9b2e32aea1b"
            ]
        ]
    },
    {
        "id": "b413d9b2e32aea1b",
        "type": "Barcode Generator",
        "z": "e027feedd4008f4b",
        "name": "QRCODE",
        "data": "payload",
        "dataType": "msg",
        "barcode": "qrcode",
        "barcodeType": "barcode",
        "options": "options",
        "optionsType": "msg",
        "sendProperty": "qrOut",
        "props": [],
        "x": 480,
        "y": 200,
        "wires": [
            [
                "37dbadb69117a532"
            ]
        ]
    },
    {
        "id": "4e8935b5ad32df21",
        "type": "inject",
        "z": "e027feedd4008f4b",
        "name": "QR Text",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "Test QR Information",
        "payloadType": "str",
        "x": 190,
        "y": 200,
        "wires": [
            [
                "075e256aa6476620"
            ]
        ]
    },
    {
        "id": "37dbadb69117a532",
        "type": "jimp-image",
        "z": "e027feedd4008f4b",
        "name": "SaveQrOut",
        "data": "qrOut",
        "dataType": "msg",
        "ret": "img",
        "parameter1": "/home/pi/QROut.bmp",
        "parameter1Type": "str",
        "parameter2": "",
        "parameter2Type": "msg",
        "parameter3": "",
        "parameter3Type": "msg",
        "parameter4": "",
        "parameter4Type": "msg",
        "parameter5": "",
        "parameter5Type": "msg",
        "parameter6": "",
        "parameter6Type": "msg",
        "parameter7": "",
        "parameter7Type": "msg",
        "parameter8": "",
        "parameter8Type": "msg",
        "sendProperty": "qrOut",
        "sendPropertyType": "msg",
        "parameterCount": 1,
        "jimpFunction": "write",
        "selectedJimpFunction": {
            "name": "write",
            "fn": "write",
            "description": "Write to file. NOTE: You can specify an alternative file extension type to change the type. Currently support types are jpg, png, bmp.",
            "parameters": [
                {
                    "name": "filename",
                    "type": "str",
                    "required": true,
                    "hint": "Name of the file",
                    "defaultType": "str"
                }
            ]
        },
        "x": 650,
        "y": 200,
        "wires": [
            [
                "68b8d028400caac8"
            ]
        ]
    },
    {
        "id": "68b8d028400caac8",
        "type": "jimp-image",
        "z": "e027feedd4008f4b",
        "name": "Scale",
        "data": "qrOut",
        "dataType": "msg",
        "ret": "img",
        "parameter1": "1440",
        "parameter1Type": "num",
        "parameter2": "1072",
        "parameter2Type": "num",
        "parameter3": "Middle Centre",
        "parameter3Type": "alignMode",
        "parameter4": "",
        "parameter4Type": "none",
        "parameter5": "",
        "parameter5Type": "msg",
        "parameter6": "",
        "parameter6Type": "msg",
        "parameter7": "",
        "parameter7Type": "msg",
        "parameter8": "",
        "parameter8Type": "msg",
        "sendProperty": "imgScale",
        "sendPropertyType": "msg",
        "parameterCount": 4,
        "jimpFunction": "contain",
        "selectedJimpFunction": {
            "name": "contain",
            "fn": "contain",
            "description": "scale the image to the given width and height, some parts of the image may be letter boxed",
            "parameters": [
                {
                    "name": "w",
                    "type": "num",
                    "required": true,
                    "hint": "the width to resize the image to"
                },
                {
                    "name": "h",
                    "type": "num",
                    "required": true,
                    "hint": "the height to resize the image to"
                },
                {
                    "name": "alignBits",
                    "type": "alignMode",
                    "required": false,
                    "hint": "A bitmask for horizontal and vertical alignment. Jimp.HORIZONTAL_ALIGN_LEFT | Jimp.HORIZONTAL_ALIGN_CENTER | Jimp.HORIZONTAL_ALIGN_RIGHT | Jimp.VERTICAL_ALIGN_TOP | Jimp.VERTICAL_ALIGN_MIDDLE | Jimp.VERTICAL_ALIGN_BOTTOM;"
                },
                {
                    "name": "mode",
                    "type": "resizeMode",
                    "required": false,
                    "hint": "A scaling method (e.g. Jimp.RESIZE_BEZIER)"
                }
            ]
        },
        "x": 810,
        "y": 200,
        "wires": [
            [
                "b4926c1e50626d55",
                "2cec36f0d095a4a1"
            ]
        ]
    },
    {
        "id": "b4926c1e50626d55",
        "type": "image viewer",
        "z": "e027feedd4008f4b",
        "name": "img",
        "width": "300",
        "data": "imgScale",
        "dataType": "msg",
        "active": true,
        "x": 970,
        "y": 240,
        "wires": [
            []
        ]
    },
    {
        "id": "2cec36f0d095a4a1",
        "type": "jimp-image",
        "z": "e027feedd4008f4b",
        "name": "SaveFile",
        "data": "imgScale",
        "dataType": "msg",
        "ret": "img",
        "parameter1": "/home/pi/1440x1072_0.bmp",
        "parameter1Type": "str",
        "parameter2": "",
        "parameter2Type": "msg",
        "parameter3": "",
        "parameter3Type": "msg",
        "parameter4": "",
        "parameter4Type": "msg",
        "parameter5": "",
        "parameter5Type": "msg",
        "parameter6": "",
        "parameter6Type": "msg",
        "parameter7": "",
        "parameter7Type": "msg",
        "parameter8": "",
        "parameter8Type": "msg",
        "sendProperty": "imgMod",
        "sendPropertyType": "msg",
        "parameterCount": 1,
        "jimpFunction": "write",
        "selectedJimpFunction": {
            "name": "write",
            "fn": "write",
            "description": "Write to file. NOTE: You can specify an alternative file extension type to change the type. Currently support types are jpg, png, bmp.",
            "parameters": [
                {
                    "name": "filename",
                    "type": "str",
                    "required": true,
                    "hint": "Name of the file",
                    "defaultType": "str"
                }
            ]
        },
        "x": 1140,
        "y": 200,
        "wires": [
            [
                "8f1106929a4859aa"
            ]
        ]
    },
    {
        "id": "8f1106929a4859aa",
        "type": "debug",
        "z": "e027feedd4008f4b",
        "name": "msg",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1370,
        "y": 200,
        "wires": []
    },
    {
        "id": "f9e7eb3251a6fefb",
        "type": "comment",
        "z": "e027feedd4008f4b",
        "name": "Problem Here!",
        "info": "Image Properties:\n\n1440 x 1072 pixels: Ok\nType BMP: Ok\nRGB but not 24bits 8x8x8!: NO Ok!\n\nI need RGB 8x8x8 24bits.\n\n\nThank you for reading and help me! ;)",
        "x": 1190,
        "y": 160,
        "wires": []
    }
]```

Can I ask, why do you "need" a 24bit BMP?

Of course you can know... :wink:

I have a Waveshare 6 inch HD e-paper display, and this model needs 1440x1072 resolution and 24 bit RGB 8x8x8 to display an image...
That's why the question of whether I can convert the image to that color resolution in the Node-rec.contrib.image-tools ...
I'm not very good at programming...that's why I love Node-red!

if you have another way to do it, I'm very willing to try... you are the experts :slight_smile:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.