# SpriteManipulation

**URL:** https://discourse.processing.org/t/spritemanipulation/45590
**Category:** Development
**Created:** [January 14, 2025, 8:30am UTC](https://discourse.processing.org/t/spritemanipulation/45590 "2025-01-14T08:30:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JALAJ\_0106](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@JALAJ\_0106](https://discourse.processing.org/u/JALAJ_0106)
#### Post date: [January 14, 2025, 8:30am UTC](https://discourse.processing.org/t/spritemanipulation/45590/1 "2025-01-14T08:30:44Z")

</div>

I was thinking maybe we could update the PImage class to include graphics rendered sprite tessalation.  
Example:

```processing
Pimage texture = createImage(8, 8, ARGB);
PImage spritemap = loadImage("some.png");

texture.sampleSprite(spritemap, x, y);

void sampleSprite(PImage smap, int startx, int start y)
{

// Nested for loop texture.set(x, y, smap.get(startx, starty)); and so one. But makes a gpu call to run In parallel.

}

```

I was also thinking related to this,  
It woulf be nice to have a livrary like peasycam  
That assist in making custom gpu shaders. It not particularly difficult to write opengl shaders and vulkan shaders are the same thing, but implementing them more difficult

Maybe

```processing
PushMatrix()
translate(such and such);
rotate(around);
scale(thewall);

Shader.callVShader(vertex[x] somepoints)
{

vertx = vertex[x];

Vert = vertx * somestuff * matrix();

ShaderVertex(vert);

}

Shader.callPShader()
{

// Some cool math stuff;

ShaderPixel(color(somecolor));

}

```

Call it PeasyShader

---

<div class="post-metadata">

### Author: ![ProcessingOrg](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/processingorg/32/18341_2.png) [@ProcessingOrg](https://discourse.processing.org/u/ProcessingOrg)
#### Post date: [January 29, 2025, 12:25pm UTC](https://discourse.processing.org/t/spritemanipulation/45590/2 "2025-01-29T12:25:31Z")

</div>

Your post has been edited to format the code for better readability. Please review our [FAQ](https://discourse.processing.org/t/guidelines-asking-questions/2147#is-your-post-formatted-9) or refer to the animation below for guidance on posting code. Thank you!

![ezgif.com-gif-maker (1)](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/3/4/34521338de6902479873291389bf53a11d12237d.gif)

---

<div class="post-metadata">

### Author: ![sableraph](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sableraph/32/251_2.png) [@sableraph](https://discourse.processing.org/u/sableraph)
#### Post date: [January 29, 2025, 12:38pm UTC](https://discourse.processing.org/t/spritemanipulation/45590/3 "2025-01-29T12:38:17Z")

</div>

Hey @JALAJ_0106! These ideas sound like a great fit for a library, which is the best way to extend Processing with new functionality. If you’re interested in contributing, we now have a [new library template](https://github.com/processing/processing-library-template) that makes it much easier to get started 😃 Let me know if you’d like more details!
