GH_MemoryBitmap not working

I discovered today that a script using the GH_MemoryBitmap class is no longer working. It was working last year when I wrote it, and I don’t know when it stopped (I don’t use it regularly). Now anything I run through a GH_MemoryBitmap ends up as a null on the other side.

I had been using this class to do simple bitmap operations (greyscale filters, contrast change). Here’s an example that should produce a greyscale version of the input bitmap.

       private void RunScript(System.Object bitmap, ref object Bmp)
    if ( bitmap != null ) {
      System.Drawing.Bitmap img = bitmap as System.Drawing.Bitmap;
      System.Drawing.Bitmap bitCopy = (System.Drawing.Bitmap) img.Clone();
      GH_MemoryBitmap mem = new GH_MemoryBitmap(bitCopy);
      Bmp = bitCopy;

Anyone else having a similar issue? Any reason this would have changed recently? Using Windows 10 with Rhino Version 7 SR19
(7.19.22165.13001, 2022-06-14)


Ok, I feel silly now. GH_MemoryBitmap is not the problem, seems to be the type of bitmap input. Trying to sort out the difference now and will report back if/when I figure out.

So far, it seems like GH_MemoryBitmap does not play well with images stored as .jpg format, but does work for .png. Also works if the bitmap is internalized in a GH component and not linked to any file. Anyone know why that might be the case?