@ealione I'm just saying that it's better to use scanLine than setPixel() or pixel() for larger manipulations. About the datatypes: QScriptEngine can pass or take QVariants which can be converted into QVariantList or QVariantMap. A QVariantList is just a QList<QVariant>. If you look at this example you will see that you can create custom Objects and register them so your ScriptEngine will know what they are. You could create a struct which contains the x-coordinate, the y-coordinate and a new red, blue and green value to set. Add each struct to a QVariantList and pass it to your slot which manipulates the image. Now iterate over each pixel on the image using scanLine(if you want) and set the new value if your list has a new value for the pixel. For the reading part: Same struct, read the x, y, red, green and blue into the struct, write the struct into a QVariantList for every pixel you want and then return it to your ScriptEngine.
Also you could use a QVector<int> (as mentioned in the example).