Login | Register 
Products Applications Downloads Features Wiki forum Store
 

TOPtoCHOP > CHOPtoTOP

Still a little green? Ask your beginner's questions here

TOPtoCHOP > CHOPtoTOP

Postby rodberry » Wed Nov 18, 2009 10:31 pm

this is really a beginners' question (even after using Touch for an embarrassing number of years) ...

If I make a TOP into a CHOP then try to change it back into a TOP, somehow the CHOPtoTOP operator only wants the first four channels and calls them r,g,b and a.

so, if I use a Shuffle TOP to sequence the channels by name, then I have four channels that the CHOPtoTOP turns into a one-pixel-high image - but at least all the pixels are actually there.

so, how do I get this back into an image withe pixels where they should be (in this case and 8 x8 version of mr. smiley for simplicity).??

after thinking to myself, "What would Achim do???" I used a SOPtoCHOP and a Channel SOP to add the pixel values to the point colors of a grid to get an image on a rectangle. An orthographic render of the camera view would give me a TOP - but surely there must be a more straightforward way to do this?

a related problem is how to make an image from a DAT with values for pixels

Some related stuff is discussed here:
http://www.derivative.ca/Forum/viewtopic.php?f=4&t=1230&p=3969&hilit=chopto#p3969

... but a simple example for beginners would be good.

(gotta go before Touch causes my laptop to burn a hole in the cafe table...)

cheers,

Rod.
Attachments
TOPtoCHOPtoTOP01.tox
(1.57 KiB) Downloaded 22 times
User avatar
rodberry
 
Posts: 899
Joined: Wed Nov 14, 2007 1:51 pm
Location: Hobart, Tasmania, Australia

Re: TOPtoCHOP > CHOPtoTOP

Postby snaut » Thu Nov 19, 2009 6:25 pm

Hey Rodney,

attached is a little component that should do what you wanted. I used a small glsl pixel shader to rebuild the original image.

For converting a DAT into a TOP i can only think about using a DATto CHOP...

cheers
Markus
Attachments
TOPtoCHOPtoTOP.tox
(2.02 KiB) Downloaded 28 times
User avatar
snaut
Staff
 
Posts: 325
Joined: Mon Nov 12, 2007 5:21 pm
Location: Toronto

Re: TOPtoCHOP > CHOPtoTOP

Postby felix » Fri Nov 20, 2009 12:58 pm

I've tried it with other images but there's an aliasing issue.
The coordinates or something are dephased by 1.5 pixels or so in one example.
I've changed the 10th line from int to float and added 1.5 but this value is different
for other resolutions so this is not a valid solution to this issue.

switch between both shaders with the switch TOP ("pixel" op).

TOPtoCHOPtoTOP_BIS.tox
(6.27 KiB) Downloaded 25 times
felix
 
Posts: 106
Joined: Wed Nov 14, 2007 1:20 pm

Re: TOPtoCHOP > CHOPtoTOP

Postby rodberry » Fri Nov 20, 2009 5:30 pm

thanks Felix and Markus,

I'll study these.

I still think it's a conceptual bug in Touch that you can't just go TOPtoCHOP > CHOPtoTOP and get the same image you put in. It would make it easier for a beginner to get bold with their data. greg once sid there are good reasons for it because of the kind of things we would want to do with the images etc. but I still think it would be better for touch as a 'language' to be able to translate bidirectionally between its different 'domains'. For me, that's the gorgeous thing about Touch - everything is just a bunch of numbers and you can mess them up and see what happens...

Rod.
User avatar
rodberry
 
Posts: 899
Joined: Wed Nov 14, 2007 1:51 pm
Location: Hobart, Tasmania, Australia


Return to Beginners

Who is online

Users browsing this forum: itaru and 1 guest