class SFML::Image

CPU-side bitmap. Lives in main memory and supports per-pixel reads / writes — handy for procedural generation, screenshots, masks, and anything that needs to inspect or modify pixel data before upload.

img = SFML::Image.new(800, 600, fill: SFML::Color.cornflower_blue) img = SFML::Image.load(“assets/hero.png”)

img[10, 20] = SFML::Color.red img[10, 20] #=> Color(255, 0, 0, 255)

img.flip_vertically img.save(“out.png”)

Convert to a GPU-side texture for drawing:

tex = SFML::Texture.from_image(img) sprite = SFML::Sprite.new(tex)