# Accurately placing colors from image on surfaces

**URL:** <https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981>\
**Category:** Geometry\
**Tags:** revit, geometry, dynamo\
**Created:** [February 1, 2021, 7:41pm UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981 "2021-02-01T19:41:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [February 1, 2021, 7:41pm UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/1 "2021-02-01T19:41:22Z")

</div>

Hi guys

I’ve posted about this a while ago.  
I’ve got artworks done by an Artist that we are intending on using to create tiling drawings on a roof surface. I have successfully created a script that transfers the colors from the artist’s image onto the tiling and also exports them to a Revit view.  
My issue is that the image does not accurately position itself in the area that’s to be tiled. I made sure the image is the exact proportion to the area to be tiled and it still does not work properly. I’ve tried to use the blue line in the image below to illustrate the problem. I will appreciate any suggestions. Please see images and dyn file attached.  
Thanks!

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/5/5581ec8d4d26b195a382654e71be89cc3736351a.png) ![Segment 1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/4/14ef1a5856c8738a800e984223a881d67a8a805e.jpeg) ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/0/b03f286a8b9216ed3239ec91edc26a0f7624c328.png)

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [February 1, 2021, 7:47pm UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/2 "2021-02-01T19:47:26Z")

</div>

Another question is how do I trim the colored filled regions in the Revit project with a shape the represents the outline of the tiling area?  
Thanks again.

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [February 2, 2021, 6:19am UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/3 "2021-02-02T06:19:46Z")

</div>

> [@bayowindapo](#):
>
> My issue is that the image does not accurately position itself in the area that’s to be tiled.

 ![imageMapping_2021-02-02_11-45-05](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/f/cf75e3ffffc6be2878002ebc77d83ddfd3511427.png)  
[imageMapping.dyn](https://forum.dynamobim.com/uploads/short-url/kU32DgIT5vds6cuJXwFbCn8iKc5.dyn) (21.2 KB)

> [@bayowindapo](#):
>
> Another question is how do I trim the colored filled regions in the Revit project with a shape the represents the outline of the tiling area?

You could extract the color information and ‘pixelate’ the Revit surface based on the tile size in Dynamo. Hope I make sense.

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [February 2, 2021, 8:51am UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/4 "2021-02-02T08:51:39Z")

</div>

Ahh this looks like just what I need. Thanks a lot. I’ll give it a go.

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [February 2, 2021, 11:47am UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/5 "2021-02-02T11:47:01Z")

</div>

Hey @Vikram_Subbaiah any idea if there is a way of splitting colored filled regions in the Revit project with a shape in dynamo? I need to remove the black areas in the image if possible.

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [February 2, 2021, 7:53pm UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/6 "2021-02-02T19:53:50Z")

</div>

> [@bayowindapo](#):
>
> a way of splitting colored filled regions in the Revit project with a shape in dynamo

You could create tiles in a Revit Project view as filled regions …

 ![Project1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/5/454cc2e3291d2f37346b5fe42099b34b3fbc9b19.jpeg)

You will need to make adjustments depending on project units, tile size, tile colors etc

 ![imageMapping1_2021-02-03_01-13-28](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/b/9b86935c30961700befc359e5c3846d945240d0a.png)

[imageMapping1.dyn](https://forum.dynamobim.com/uploads/short-url/uyvauXGgvHgTUFD2GldbOOlnq2t.dyn) (59.3 KB)

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [February 3, 2021, 7:50am UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/7 "2021-02-03T07:50:16Z")

</div>

Thanks so much!  
I’ll have a look. Much appreciated.

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [February 3, 2021, 4:51pm UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/8 "2021-02-03T16:51:29Z")

</div>

Thanks again.  
This happened on my first attempt at using the script.  
What could be the problem? I’ve literally just tried to replicate what you did.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/3/93436bd29f3749afd5df2b02740a8b55ca490ad6.png) ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/4/a4de69fe4b5ff05dadb320ed0ab48fc84f8e5dca.png)

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [February 3, 2021, 5:07pm UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/9 "2021-02-03T17:07:53Z")

</div>

Figured it out. Thanks.  
SortedList has to be written like this.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/9/194aa3be7c87c4a599cf6b921972389469434360.png)

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [February 3, 2021, 7:53pm UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/10 "2021-02-03T19:53:10Z")

</div>

Hi Vikram thanks again for the script. It should do the job. One issue I’m having now is figuring out a way to import the surfaces of a particular filled region type from a view into dynamo and then using the real outline of the artwork shape to trim them or intersect with them.

I’ve got over 3000sqm of tiling area to cover so selecting multiple faces of filled regions in view or manually trimming the edges would be quite laborious and a take a lot of time. I looked through the other topics and I could not find a suitable solution.

Thank you!

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [February 4, 2021, 7:20am UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/11 "2021-02-04T07:20:00Z")

</div>

> [@bayowindapo](#):
>
> using the real outline of the artwork shape to trim them or intersect with them

That would be a resource heavy task as you’ll need to analyze the pixels in the image and determine the edges. There was a discussion about this on the forum a long time ago (you’ll need to search some more), but I don’t think it is something Dynamo is suited for.

You can take a look at [this](https://gitbook.testingwaters.in/lists/geometry-from-image) for reference though

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [February 4, 2021, 10:43am UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/12 "2021-02-04T10:43:06Z")

</div>

Hi Vikram

I really appreciate the help. This is a much better method than what I was using previously. Working out the areas will be much faster. For my purposes I had to adjust the script to reflect the actual dimensions of the surface as per the image below. This of course makes it a much heavier process. Thanks again.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/4/44eb5c353046a0d11d6478b486daa01a755bf9e6.png) ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/6/761a584c1a40b88c29afcc223847a45f9ec3c987.png)

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [February 4, 2021, 11:40am UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/13 "2021-02-04T11:40:38Z")

</div>

Hi Vikram. Sorry another question.  
Having an issue figuring this out.  
What would the script look like if the tiles had the same width but different heights. Say 75,150,75. In such a way that it forms a pattern as per the image below?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/a/6ad89568dade1033a5cd0d94e0712f5c28a44af7.png)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [February 5, 2021, 7:05am UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/14 "2021-02-05T07:05:10Z")

</div>

Since you can only get the pixel values at equal intervals, you will need to either  
consider all tiles to be of the smaller dimension and combine every third tile with the second  
consider all tiles to be of the larger dimension and split every alternate tile

Not sure about how I’d proceed after this, but this would most probably be the way I would begin.

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [February 5, 2021, 12:49pm UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/15 "2021-02-05T12:49:47Z")

</div>

Hi Vikram.

I thought as much. Hopefully such a functionality can be included in dynamo in future.  
For now I’d just have to propose we use a regular pattern.  
Here is a link to the project if you’re interested in viewing. [https://news.bahai.org/story/1438/](https://news.bahai.org/story/1438/)  
Thanks gain.

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [June 8, 2022, 8:09am UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/16 "2022-06-08T08:09:09Z")

</div>

@Vikram_Subbaiah, here is an image of the project I went through this effort for.  
Thanks so much for the help!  
Great to see a script being put into action.

 ![WhatsApp Image 2022-06-08 at 9.38.02 AM](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/0/d0355281431e51584a2d883a54c4bf34f7558541.jpeg)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [June 8, 2022, 11:19am UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/17 "2022-06-08T11:19:04Z")

</div>

> [@bayowindapo](#):
>
> here is an image of the project

Good to see the practical results of Dynamo being utilized as part of a design process.  
Thanks for sharing

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [August 24, 2022, 9:40am UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/18 "2022-08-24T09:40:28Z")

</div>

I have published a write-up about the process on the Dynamo blog.

[https://dynamobim.org/bahaʼi-house-of-worship-dr-congo-tiling-automation/](https://dynamobim.org/baha%ca%bci-house-of-worship-dr-congo-tiling-automation/)

---

<div class="post-metadata">

**Author:** ![bayowindapo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bayowindapo/32/184532_2.png) [@bayowindapo](https://forum.dynamobim.com/u/bayowindapo)\
**Post date:** [September 12, 2022, 12:47pm UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/19 "2022-09-12T12:47:37Z")

</div>

Another site progress image. 😀

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/0/209ad52feab570a86052f1571420cf4924d26e47.jpeg)

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [September 12, 2022, 1:39pm UTC](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981/20 "2022-09-12T13:39:40Z")

</div>

This is beyond awesome to see @bayowindapo 🤩 Please do keep updating us as this progresses!

[Next page](https://forum.dynamobim.com/t/accurately-placing-colors-from-image-on-surfaces/59981.md?page=2)
