Image Sampler - Grasshopper Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys and welcome back to the studio o2 channel where we focus on architecture and technology today i'm going to show you how to use rhino and grasshopper to turn this into this so let's just jump straight into it come on okay so the first thing that we're going to need to do is open up photoshop or if you don't have photoshop we can use photope and we're going to need to download a few images and i've already downloaded a couple of images we're going to try two different examples one with this image of nic cage and another one with this flower and this is a bit more of an obvious example because it's sort of like either gray on the edges black in the center or white whereas nick has sort of these gradients and a lot of detail in the face anyway so we need to resize these images so first we're going to go to image and then to image size or alt ctrl i and we're going to keep it linked and then we're going to make width of 200 and then it'll auto create the height of 104 click ok and then we're going to do the same process for the other image go to image image size and then we'll create the height to 200 and it'll make the width 133. it's all important that we remember these numbers because we're going to need them later in our grasshopper script so we're going to export these as jpegs so just do ctrl alt shift and w to export or if that's too many for your fingers then file export export as and we'll just export them as jpegs and we'll call this flower edit and then we'll do the same for nick export as a jpeg and just call it nick edit [Music] okay now we will go to rhino and we'll also open up grasshopper so to get this script working the first thing that you're going to want to do is open an image sampler component so we'll double click and we'll type image sampler and we'll copy and paste that twice because we know that we've got two images so right click on it and then click on image and then we'll open our edited image and we know that nick was a width of 200 pixels and a height of 104 pixels and then we'll load in our flower and we know that our flower was we'll double click on the image to bring up this sampler window our flower in the x domain was 133 and the y domain was 200. so we're going to create a square grid first now that we've loaded our images in and we want our x and y components to match with our image so in nick's case the y domain should actually be 104 and the x domain should be 200 and this is why it's important to write these numbers down because i get it wrong all the time so nick's y is 104 and his x is 200 so y is 104. and x is 200 and this is our square grid and we just use one for the size and we're going to plug our points into nick and it's the wire is now dashed because it's sending lots of discrete pieces of information as opposed to just single pieces of information like the number sliders are here and then i'll show you what happens when we don't define the size of these circles so i'm going to hide all of this square grid stuff just by highlighting it and then clicking on the center of the mouse wheel to bring up this hot wheel this quick access hot wheel and i'm going to disable the preview and now we'll create a circle and we just want to use the circle based on a plane and a radius so our plane is going to come from all of the points you can see we've created lots of circles and their center point will be on where the square grid was so if we turn that on we can see that all the center points are aligned to the square grid and then we're going to just take nick and plug him into the radius and it's clearly done something but we've got a lot of circles sort of overlapping and we've lost a lot of the detail in this image so to try and bring some of that back we're going to need to control the bounds of the circles so we need to construct a bounds and these bounds are going to be coming from obviously nick and the image sampler and then we need to remap the numbers so that the radius aren't so large and we'll control the radius by constructing a domain so our domain will run into our target and our source will be the bounds of nick and then nick himself will be our values to be remapped so our domain will probably go from something like 0.5 to 0.01 and now we'll add these remapped numbers into the circles and you can see that we've got a lot more value a lot more detail in the image now and it looks like it's becoming smaller where it's darkest and if we want to sort of swap that around we'll just change the direction of the domain and now the circles are larger where he's darkest something going on with the background here and i want to make a comment about how the image sampler now works with more complex images like nick cage and sometimes you can get a little bit confused with high detail images so that's why we're doing this other example with a flower which we're going to do now so i'll just go ahead and turn all of this off so we're just going to copy and paste all this information that we have from nick all these components and we're just going to reuse them on the flower image so it's got a height in the y domain of 200 so we'll swap that over and it's got a width of 133 and we'll plug that into the x now so we can turn this bit on and plug that into the flower and we'll see that we're getting correct information out of the flower image and now we have our flower this is sort of a lot clearer as to where there are perforations and where there aren't perforations the image might not be perfectly white which is why we are still ending up with some residue sort of circles here but that's something that you can fix in photoshop and just make sure that it's all a perfect white color but that's the example for today it's pretty simple script and interesting way to use image sampler i'll catch you in the next one thanks for watching bye
Info
Channel: Owen O2
Views: 161
Rating: 5 out of 5
Keywords:
Id: iAm8XnROuTY
Channel Id: undefined
Length: 9min 26sec (566 seconds)
Published: Wed Jul 07 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.