Remove embed flag to pictureframe image

I often load dwg files with raster maps already referenced.
When opening or importing them in Rhino they are loaded as pictureframe, with the images embedded in the file.
I often have many big raster maps, and an “empty” file easily grows over the Gb in size, with the many problems related.
Is there a way to remove the embed flag?
As an alternative I was thinking about the possibility to have a script saving the image path and frame dimension, delete it and reload with embed option off.
Would it work?
By the way… It the path absolute or relative?

Thanks in advance,

Hi Massimo - you can remove the embedded bitmaps, but it is an all-or-nothing action - it will delete all embedded bitmaps from the file. testPurgeBitmapTable Deleting the pictureframe will not get rid of the embedded bitmap. I’ll see if I can make something to automate this so you still have the images.

@max72 - see if this script helps at all - you can use RunPythonScript to try it out. You’re prompted to select picture frames but the script is a bit quick and dirty and does not check to see if it is a picture frame… so that’s up to you, but, here it does seem to work to replace an embedded pictureframe with one that is not embedded. It does not do the purging - you need to testPurgeBitmapTable and Save after running the script.
The script is guaranteed not thoroughly tested so please try it first on a copy of a file to make sure it does what you want. (978 Bytes)

V6/WIP does not embed pictureframe images, btw…


Thanks Pascal!
With topographic maps testPurgeBitmapTable works a treat, and alone is enough.
Saving and reopening I have the images referenced externally, and small files, even without the script.

I tried to open and import the dwg files with the latest V6/wip, but it still embeds the images, like with V5. Moreover testPurgeBitmapTable is not working anymore, so I cannot reduce the file size this way. I can provide some test files if you are interested.

Being there would you consider adding at the bottom of the todo list jpeg 2000 (jp2) support?

Thanks again.

Hm- I’ll test this, thanks for the heads up - the Picture command (renamed from PictureFrame )should not embed, but it may be that the importer for dwg still does -maybe just an oversight - if you have one of these that I can test please post it or send to to my attention.



I attach a very small example, it should be enough to test it without handling files too bulky, but I have examples of any size in case… :slight_smile:
Massimo (156.0 KB)

Hi Massimo - sorry, I was not clear about what V6 does - it does not embed Pictures in the ‘bitmap table’ where the user, other than the test command I gave you, has no access. What it does now is treat Picture images like other textures in materials, so that if the file is saved with ‘Save textures’ the images will be saved for all materials.

I see that this is not 100% clean since one might well wish to handle Picture textures specifically and differently from regular materials just because of how big they can get… I’ll dig into this some more.


I understand this is not the normal way to use Rhino, but besides the image embed (solved in V5) it really excels there too, even if it’s not a GIS.
With many big images having them as external reference is vital.
If you need other examples I’m at your disposal.
Thanks again,