GetPixel
and SetPixel
are inherently super slow . I would consider going with an alternative approach before threading them (as per the hits in the Google search).
Edit: Here’s a relevant thread:
Hi Jørgen,
I did some optimization without the bitlocking Dale suggested. I think that will be even faster but I have no time to check that out.
What I did was create a new color directly from the pixelcolor.
640 x 407 pixels. Total = 260480
JH_version : 8.17264556885
640 x 407 pixels. Total = 260480
WD_version : 2.88730621338
import scriptcontext
import System
import rhinoscriptsyntax as rs
import time
def JH_version():
# Capture the active view to a System.Drawing.Bitmap
bi…
Also, you can syntax highlight your code like so:
Topics related to RhinoScript and Python scripting.
Syntax Highlighting:
Format and highlight your script code by fencing your code block within three back ticks. If you name the language your script is in, you get syntax highlighting, too:
Python:
```python
# Your python code here
print “Hello Pythonic World”
```
becomes
#Your python code here
print "Hello Pythonic World"
VBScript:
```vbscript
’ Your VBScript code here
print “Hello VBScript”
```
becomes
' Your VBScript code he…