Image I\O From ICE

Plugins linking to this thread: (hide)

Image I/O from ICEAuthor: Oleg Bliznuk
Originally developed for testing his Implosia FX toolset, Mr. Core recently released these compounds that allow to import and export image (.BMP/.TIFF/.PNG/.JPG) and mesh files (.OBJ, UV not yet supported) within ICE.

For image handling, this package includes the Build PCloud from Image compound that converts the output array from the IFX Read Image node into a pointcloud, which can be further modified by ICE and then written back to an image file through the factory build array from set node plugged into IFX Write Image. This allows a PixelParticles-like workflow (See PixelParticles description further below) for doing for example image manipulations inside ICE.

The local backup archive contains all files collected from the si-community thread (see below) including some additional compounds by Fabricio Chamon which handle file name/format string conversions. To install, copy the .xsicompound files into the Data/Compounds folder of the USER or a workgroup/addon directory. The .dll file goes into the Plugins subfolder — demo scene file is included.

Related plugins: Pixel Particles, Image ICE Node

local backup: ImageIO_packed_1.0.zip

User avatar
Mr.Core
Posts: 148
Joined: 10 Aug 2011, 12:35
Skype: giga-core
Location: Kharkov, Ukraine

Image I\O From ICE

Post by Mr.Core » 15 Dec 2011, 21:55

Hi!
Just a simple set of custom nodes to get ability write\read Images ( bmp\tiff\png\jpg ) and wavefront .OBJ files ( currently only point positions and polygonal description without a textures and matID ) from ICE ( yes, I know that it useless in 95% cases, but probably will be nice as a toy, I am personally using it for imposia's debugging purposes ). Have a fun!
x64 only, tested under 2012\2012.5
Download here
Probably will be necessary to donwload a vs2010 redistr from here
Attachments
1.jpg
1.jpg (147.09 KiB) Viewed 9691 times

Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: Image I\O From ICE

Post by Pooby » 15 Dec 2011, 22:54

ooh.

can you get closest location etc from the pixels? How does it work if there are no points or particles?

It looks very interesting indeed, but what can it do?

User avatar
Mr.Core
Posts: 148
Joined: 10 Aug 2011, 12:35
Skype: giga-core
Location: Kharkov, Ukraine

Re: Image I\O From ICE

Post by Mr.Core » 16 Dec 2011, 07:49

It reads image from disk and outputs as array of colors, from the left to right and from the top to bottom ( x1\y1 // x2\y1 .... xWidth \ y1 ................ x1\yHeight ..... xWidth \ yHeight )
Of course you can get closest location\raycast if you apply this array to point cloud grid

Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: Image I\O From ICE

Post by Pooby » 16 Dec 2011, 11:50

I see. So how do you write changed colour values back to the image?

Also, whats the installation procedure? Im useless with plugins

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Image I\O From ICE

Post by Hirazi Blue » 16 Dec 2011, 12:01

Without having tried this myself (yet) and merely looking at the rar-file, I would assume, you'd have to drop the dll into the "Application > Plugin" folder in your Softimage User directory or your preferred workgroup... I assume you can get the necessary ICE Nodes out of the included scn-file and would have to resave them in an appropriate location.
(But that's just guessing, as I haven't opened the file yet).
;)
Stay safe, sane & healthy!

User avatar
Mr.Core
Posts: 148
Joined: 10 Aug 2011, 12:35
Skype: giga-core
Location: Kharkov, Ukraine

Re: Image I\O From ICE

Post by Mr.Core » 16 Dec 2011, 13:03

>>So how do you write changed colour values back to the image?
BY the node called "IFX Write Image" wich is get three arguments - width\height and array of colours. You can modify colors by two ways - 1) apply it to point cloud and further works with points as with pixels and 2) do direct processing by usage of some logical trick with the indexation of arrays ( nodes like modulo\divide\round etc )

The installation procedure is exactly what Hirazi said, except resave because there are no additional compounds
list of nodes in this dll:
IFX Read Image
IFX Write Image
IFX Read OBJ
IFX Write OBJ

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Image I\O From ICE

Post by Hirazi Blue » 16 Dec 2011, 15:15

The scn-file crashes on me each and every time I try to load it.
The ICE compounds seem okay though,
if only I knew what they are meant to do exactly... :-\
Stay safe, sane & healthy!

User avatar
Mr.Core
Posts: 148
Joined: 10 Aug 2011, 12:35
Skype: giga-core
Location: Kharkov, Ukraine

Re: Image I\O From ICE

Post by Mr.Core » 16 Dec 2011, 15:32

Did you got any error mesage on crash ? And what is your version of xsi ?
basic description of nodes
READ IMAGE
inputs:
File Name: - image file name including full path
ActiveProject as root: means that actual project path will be added to image file path ( like "D:\\"you_proj_path_name\" + image name which you put )
outputs:
Raw pixels: - array per object of colours ( each element = 1 pixel, pixels are readed from the left to right and from the top to bottom )
Width: -width of image ( number of pixels in horizontal )
Height: - height of image ( number of pixels in vertical )
//
WRITE IMAGE
File Name: similar to previous node
ActiveProject: also similar, but new image will be created in "your_proj_name\Render_Pictures" folder
Width\Height: - similar to previous
Color data: - array of colors per object to store it to the result image ( array of pixels )
Enforce Evaluation: - this port must be evaluated to get node aslo be evaluated, there are two ways to do it - 1) connect to node "Log values" and 2) show this attribute in the viewport

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Image I\O From ICE

Post by Hirazi Blue » 16 Dec 2011, 15:35

Thanks for the description...
I tried to load the scn-file into SI2012 SP1 and my current SI2012 SAP and I didn't get any error messages. Strangely it happens while SI is (re)creating the layout, as the explorer shows the loaded objects already...
Stay safe, sane & healthy!

User avatar
TwinSnakes007
Posts: 316
Joined: 06 Jun 2011, 16:00

Re: Image I\O From ICE

Post by TwinSnakes007 » 16 Dec 2011, 22:23

What class in the SDK are you using to write the image out?

User avatar
Mr.Core
Posts: 148
Joined: 10 Aug 2011, 12:35
Skype: giga-core
Location: Kharkov, Ukraine

Re: Image I\O From ICE

Post by Mr.Core » 16 Dec 2011, 22:31

I am using third party libs for that, not si SDK

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 01:41
Contact:

Re: Image I\O From ICE

Post by EricTRocks » 17 Dec 2011, 11:56

I don't see the IFX Assembly Sequence Name node in the ICE tree at all. Is there a way to use the standard tools to get it to write out an image sequence based on the frame? I'm not reading a sequence in, I just want to write out my own from scratch. I'm able to write out a single frame which is awesome. :D

This is definitely an awesome plugin!! Thanks so much!
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 01:41
Contact:

Re: Image I\O From ICE

Post by EricTRocks » 17 Dec 2011, 12:14

Something else that would be cool to have, is a node that autmatically builds a point cloud in the correct order and a node that builds the color array in the correct order from that pointcloud. Just tossing out ideas.
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

User avatar
Mr.Core
Posts: 148
Joined: 10 Aug 2011, 12:35
Skype: giga-core
Location: Kharkov, Ukraine

Re: Image I\O From ICE

Post by Mr.Core » 17 Dec 2011, 13:59

>>I don't see the IFX Assembly Sequence Name node in the ICE tree at all.
It is just a simple compound that I builded from factory nodes :)
>>is a node that autmatically builds a point cloud in the correct order and a node that builds the color array in the correct order from that pointcloud.
That is very simply to implement, fisrt case I have attached as compound called "Build PCloud From Image" , and in the second case you can just use "build array from set" node to get array of colors and connect this array to "Write Image" node
Attachments
IFX Assembly Sequence Name.xsicompound
(35.57 KiB) Downloaded 260 times
Build PCloud From Image.xsicompound
(10.41 KiB) Downloaded 265 times

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 01:41
Contact:

Re: Image I\O From ICE

Post by EricTRocks » 18 Dec 2011, 03:24

Awesome got it working! Thanks so much. Just did a simple setup using a null to modulate the color of particles inside it and output the sequence of the null moving from one side to the other.

I have to say this is really fast as well. Just played back the timeline and it zipped along as if it wasn't doing any extra calculations. :) Great job! Now I just have to figure out or dig up a compound that what pixel particles does and stick some particles to a mesh via UVs and we have a custom "pixel particles" setup.

Also anyone who is thinking of doing an ICE based renderer has an option now too. :)
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

fabricio.chamon
Posts: 94
Joined: 09 Jun 2009, 23:47

Re: Image I\O From ICE

Post by fabricio.chamon » 18 Dec 2011, 15:11

Man, this is soooo awesome! thanks a lot Mr. Core.
all kinds of image processing inside the ice tree! that's fantastic and will surely open up for a lot of possibilities.

here's a quick image blur test, along with 2 compounds that might be useful to some of you.

"Change File Name" compound: changes or appends file name of a file path input with option to keep or change extension.
(also outputs a no extension string to be fed into IFX Write Image, since it appends the format itself)

"Get IFX File Format from File Path": outputs an integer to be fed into "Format" port of IFX Write Image.
bmp = 0, jpg = 1, png = 2, tiff = 3 (defaults to bmp in case of unsupported file format)


I can't thank you enough!
Attachments
screenshot
screenshot
change_file_name.jpg (197.7 KiB) Viewed 3761 times
Get IFX File Format from File Path.xsicompound
get IFX file format from file path compound
(25.91 KiB) Downloaded 238 times
Change File Name.xsicompound
change file name compound
(37.96 KiB) Downloaded 239 times

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests