Search code examples
saveprocessingpixel

PROCCESING-Pixel operations are not supported on this device


Any code I write that requires save(), saveFrame() or functions like loadpixels() I can't use, what's stopping me from saving edited pitcures. Error it says its: Pixel operations are not supported on this device.

About my computer: Windows7 ultimate Service pack 1, 64-bit AMD A10-5800K APU with Radeon(tm) HD Graphics 3.80 GHZ

UPDATE

It works on any other computer just not mine, even some basic codes like this one for example

size(640,480);
background(255);
fill(44);
beginShape();
vertex(50,20);
vertex(600,160);
vertex(190,400);
endShape(CLOSE);
saveFrame("izlaz1.jpg");

Solution

  • I suppose that your Windows' color depth setting is set too low.

    Processing assumes that system exposes color depth as 32-bit (RGB + alpha = 4*8bit). This is fragment from PGraphicsJava2D class:

    protected WritableRaster getRaster() {
       ...
       if (raster.getTransferType() != DataBuffer.TYPE_INT) {
         System.err.println("See https://github.com/processing/processing/issues/2010");
         throw new RuntimeException("Pixel operations are not supported on this device.");
       }
       return raster;
    }
    

    So "Pixel operations are not supported" exception is raised when your system exposes to low color depth.

    Try to change your Windows' setting.

    Some helper links below:

    https://github.com/processing/processing/issues/2010

    http://helpx.adobe.com/x-productkb/global/change-color-depth-resolution-windows.html