Manipulate image with stb_image library

24年 10月 8日 Tuesday (edited)
113 words
1 minutes

The main idea is to learn how to manipulate image with C.

Topic covered

  • my personal experience about problem solving and IRC channel on libera really helped me when I struggle :)
  • pointer stuff (dereferencing, arithmatic)
  • flat array manipulation
  • find a possibilities of color combination by applying the concept of permutation using bitmask!
  • general control flow
  • stb_image library

The code

Sample

The original image: Original Image

Screenshot of generated images (256*6 = 1536 in total): Edited Image

The sephia version: Sephia Image

Lesson learned

Our eyes can see a bunch of colors, but it is merely a combination of three primary colors that trick our senses. This illustrates a simple pattern that can generate a million possible combinations, and can you imagine how wonderful it is?

Title:Manipulate image with stb_image library

Author:ReYuki

Link:https://www.reyuki.site/posts/image-manipulation [copy]

Last updated:


This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. You are free to share and adapt it, as long as you give appropriate credit, don’t use it for commercial purposes, and distribute your contributions under the same license. Provided under license CC BY-NC-SA 4.0