Image in image command

Next
 From:  bemfarmer
10813.1 
An Image file may be loaded into the MoI view from a bitmap image, PNG, JPEG, TIF, or BMP file.
More than one Image can be loaded. e.g. a 2D violin scroll image in front view, and a different 2D violin scroll image in right view.

If I load an image (or two) into MoI, and check the option to Embed image data in .3dm file, the image(s) are saved with the saved .3dm file.

Question 1: What data is saved? Where and how is it saved?
(textures?)

Question 2: If the .3dm with embedded image(s) is loaded into Rhino 7, can the Image be viewed? (No?)
Or can the image data be accessed in Rhino 7?

Question 3: If the source bitmap image is deleted from the computer, can the bitmap image be restored from the embedded image in the .3dm?
(Or if a .3dm with an embedded image is received from a 3rd party?)

Thank you,

- Brian

I seem to have a lot of questions about Image :-)
I noticed that the image can be loaded (say beginning at Origin), in any of the 4 quadrants.
Wondered if the "Left Bottom Corner", normally at the origin, still located at the origin, for the image in the other 3 quadrants?
(Of course, if so, it would not longer be either left, or bottom...)

I did look up embedding textures in Rhino:
quote:

"Save texture" is an option good for sharing Rhino files with textures to other users on other machines - the textures are packed in the Rhino file and this cause a larger size. If the Rhino file is opened at an other machine than the textures are unpacked in the working directory.



I noticed that once embedded, re-saving the .3dm to a different name.3dm, also keeps the image embedded, even though the checkbox is not checked. (not worried about this) (There must be a flag?)
(The Image can be "removed" prior to saving to .3dm)

EDITED: 14 Aug 2022 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10813.2 
Seems the image ("embeded" enabled) stay inside the 3DM even the original is erased...
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10813.3 In reply to 10813.1 
Hi Brian,

re:
> Question 1: What data is saved? Where and how is it saved?

The bitmap pixel data gets saved inside a data chunk in the .3dm file. So the bitmap will be contained inside the .3dm file and will be able to be displayed even if the original bitmap file is not present.


> Question 2: If the .3dm with embedded image(s) is loaded into Rhino 7, can the Image be viewed? (No?)
> Or can the image data be accessed in Rhino 7?

It's saved in what is called a "user data table", but the data inside the user data table is not accessible to Rhino, it doesn't know how the data inside the table is structured.


> Question 3: If the source bitmap image is deleted from the computer, can the bitmap image be restored
> from the embedded image in the .3dm?

There is not currently any method set up for extracting an embedded bitmap image out to a separate file again.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
10813.4 In reply to 10813.3 
Hi Michael,

Thank you for the responses. They make sense, and seem very logical.

Maybe I'll add "restoration of PNG, JPG, etc." to Version 6 withlist :-)

For my current low priority project, I'll just assume that for a loaded Image, that the associated PNG, etc. is available.

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10813.5 In reply to 10813.4 
Hi Brian, for the next v5 beta I've added a .getEmbeddedImage() function on background images which will return an image object that you can then call .save() on to extract an embedded background image back to a separate bitmap file.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
10813.6 In reply to 10813.5 
WOW!
Many superlatives being thought of...

Thank you Michael

I am wondering if .getEmbeddedImage function() will have any other methods? Or submethods.
(More methods not needed...)

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
10813.7 In reply to 10813.6 
Hi Brian,

re:
> I am wondering if .getEmbeddedImage function() will have any other methods? Or submethods.
> (More methods not needed...)

Well it will return a bitmap image object which has these methods on it:

.save()
.getSaveFileName()
.copyToClipboard()

and also an .isValid property.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All