Making holes in an object using an image as a reference
Assuming Cycles (and using your first sample image), you can achieve this effect using a volumetric material to render the insides of any 'holes' in the mesh :



This is achieved with the following material :



The 'surface' is a mix between a Transparent shader and a Diffuse shader (or whatever surface shader you want to use) - using the image as the mix factor. Unfortunately you cannot use UV coordinates for this since the coordinates need to also be used for the volumetric (and UVs don't support points below the surface - in my case I have used Object coordinates, passed through a Mapping nodes to allow them to be rotated and scales as desired.

For the 'internal' structure, the same image is used to affect the density of the volumetric - for the 'spaces' the density will be zero (ie, empty space) while for the 'solid' sections the density needs to be high so as to appear solid. This can be achieved using Maths nodes (in this case, Subtract from 1 (as the 'black' in the image was to be 'solid', the white 'trasparent') and then multiply by 15 for the 'high' density - even higher values will make the 'internal' substance less translucent). The Volume Scatter and Volume Absorption setup is the same as would be used for smoke (just higher density than would be typical for smoke).

To increase the quality of the volumetric you may need to decrease the 'step' size in the volumetric properties (although this will slow down the render). Also, don't forget to set Light Paths Volume scattering (in Render properties) to more than 0 (eg, 4 or 5 should be sufficient).