Skip to content

Conversation

mrjschulte
Copy link
Contributor

Add a new node to the chaiNNer toolset that will allow the user to create a Colorwheel tile at a user defined size.

Add a new node to the chaiNNer toolset that will allow the user to create a Colorwheel tile at a user defined size.
Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The color wheels produced by this node are all slightly off-center because conic_gradient is implemented incorrectly.

image

Luckily, the fix is pretty simple:

@@ -50,7 +50,7 @@ def conic_gradient(img: np.ndarray, rotation: float = 0):
     if rotation < -np.pi:
         rotation += 2 * np.pi

-    center = np.array(img.shape[:2], dtype="float32") / 2
+    center = (np.array(img.shape[:2], dtype="float32") - 1) / 2
     pixels = np.array(
         [(r, c) for r in range(img.shape[0]) for c in range(img.shape[1])]
     )

image

Could you please add this to your PR?

fix slight misalignment for center in Conic Gradient per PR feedback.
PR feedback, this node always generates RGB images so annotating that here.
@mrjschulte
Copy link
Contributor Author

Requested Fixes have been made and the PR has been updated.

@joeyballentine joeyballentine merged commit 2f9253a into chaiNNer-org:main Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants