Skip to main content
6 votes
Accepted

How to pass PNG image data directly to SDL?

SDL uses a type called SDL_RWops for this purpose. This is essentially a wrapper around a stream. When you call a function like ...
Sean Middleditch's user avatar
6 votes
Accepted

How to get rid of the white border/background on my png image?

Use a file format that supports alpha (png), an editor that can save it with a transparent background (gimp2, photoshop, basically not paint) and make sure you load the sprite correctly
Bálint's user avatar
  • 14.9k
4 votes

Performance issues with high-resolution maps in 2D strategy games

You can do something similar to what Google Maps does (at least visually): Have different quality versions of your map. When zoomed out, your entire map loads on low quality (let's say ...
Tom Tsagkatos's user avatar
3 votes

How OpenGL works with Windows GDI in order to produce output image on computer screen?

The video adapter sends to the monitor a video buffer stored somewhere in video memory. This is something the adapter does, and it is responsibility of the device driver. I am talking about a single ...
Theraot's user avatar
  • 27.2k
3 votes

Technical Design Document and PNG filesizes

PNG is an image format which uses the lossless DEFLATE algorithm to compress the image data. For that reason PNG files are usually far smaller than the sum of their pixels. Especially when you have ...
Philipp's user avatar
  • 120k
3 votes
Accepted

Technical Design Document and PNG filesizes

We know that a disk is made up of Tracks and Sectors. In Windows that means the OS allocates space for files in "clusters" or "allocation units". The size of a cluster can vary, but typical ranges ...
Uri Popov's user avatar
  • 3,027
3 votes
Accepted

How to draw an image on canvas without html

Philip's suggested improvement to DMGregory's answer is important. ...
Jose_X's user avatar
  • 146
3 votes

There any way to insert images inside the code (just for comprehesion) in any IDE compatible with Game Engine Unity3D (Monodevelop for example)?

Other than ASCII art? No, not that I'm aware of. The closest you could get would be documentation generators like doxygen that will create documentation files from comments, which might also include ...
Mario's user avatar
  • 8,497
3 votes
Accepted

2D UI - Image with 1px border randomly gets different thickness

There are a couple of points you need to take into account to solve this. First you'll want to switch your sprite's Mesh Mode in its texture import settings to Full Rect so you can enable 9-slice ...
DMGregory's user avatar
  • 135k
3 votes
Accepted

How do I detect a given sprite's bounds automatically using Java?

You first need to scan the image for the edges. You need to loop through each pixel in the image and store the position of the pixel closest to the left, the pixel closest to the right, etc. Pixels ...
Bálint's user avatar
  • 14.9k
3 votes
Accepted

Add picture in the Hierarchy view in Unity

They are hooking into the EditorApplication.hierarchyWindowItemOnGUI event. In their case they are storing a single icon texture within their editor script, and ...
Zhaph - Ben Duguid's user avatar
3 votes
Accepted

Unity Build not working because resources.assets is over 10GB in size.

Check your Build Report: When you have finished your build in Unity go to Console > Open Editor Log. Search the document on Build Report You'll see a nice overview (in percentage) of data usage ...
runningfrmyellow's user avatar
3 votes

Stopping the texture2D from stretching in RawImage

Use native unity component: Use AspectRatioFilter on the gameObject containting the rawImage, and tweek parameters as you wish.
Ugo Hed's user avatar
  • 281
3 votes
Accepted

Color of Image changes to white between 2 positions using Color.Lerp - Unity

This is because you are using Color as if it was a Color32. Color uses (float) values between 0 and 1 Color32 uses (byte) values between 0 and 255. So a value greater then one is clamped to 1 for ...
troien's user avatar
  • 906
3 votes
Accepted

How to access a ViewportTexture's depth data as an image?

Sadly, there is no built in to do this at the time of writing. Instead this is what exists: A bug report: Getting depth texture from viewports. A proposal: Accessing different viewport buffers ...
Theraot's user avatar
  • 27.2k
2 votes

Image Interpolaton for Rotation

What you call unmapped pixels are what appear as "holes" in the rotated image. In image computing (such as analysis, rendering, etc.) a rotation is a manipulation of an image A in order to obtain an ...
liggiorgio's user avatar
  • 4,866
2 votes

Got unexpected results from perlin noise. Wondering what it is doing?

You are going outside the 0..255 range. That's why you see these color bands, since you are goint the whole range of values between 0..255 for every integer. You are multiplying by 255 twice. This ...
Nils Ole Timm's user avatar
2 votes

Why Won't Image Drawing Work In JavaScript

You should use this (literally): ...
Kitanga Nday's user avatar
2 votes
Accepted

Does GLSL support multitexturing?

"Multitexturing" is an OpenGL feature from before programmable shaders; shaders pretty much made the concept obsolete, and it was quickly deprecated. Any websites you read which talk about "...
Trevor Powell's user avatar
2 votes

How can I resize pixel art in Pyglet without making it blurry?

Modern pyglet lets you set the default texture filtering by modifying a couple class attributes on Texture. Pyglet docs even explicitly mention "retro style ...
NJ is on Codidact's user avatar
2 votes

Effect only on one object (two cameras)

Everything is becoming gray because post-processing always draws the whole screen, so the effect gets applied to every pixel. Since the order of the cameras is Camera_All and then Camera_CurrentItem, ...
Victor T.'s user avatar
  • 1,381
2 votes

How to view 360 degree images in Unreal Engine 4

There are multiple ways to map a 360-degree environment to a flat image. In this case, the WPanorama images look like they were mapped cylindrically, so map it to the sides of a cylinder around your ...
Jimmy's user avatar
  • 9,029
2 votes
Accepted

How to make progress vertical bar increase instead of decrease

Delete the line cur_progress = max_progress; from your Start() method. This is the part that currently says "Start 100% full....
DMGregory's user avatar
  • 135k
2 votes
Accepted

Unable to add asset/sprite, not sure why

At the top of the Inspector, change the "Texture Type" to "Sprite (2D and UI)" Sprites support dragging them straight into the hierarchy, which automatically generates an object with a SpriteRenderer ...
DMGregory's user avatar
  • 135k
2 votes
Accepted

How to keep consistent between image quality, device range support and final size of the game?

There's not perfect answer that cover everything you've asked for. However I have some tips that can help. If you are focusing on Android, you can upload images of different sizes for different ...
Tom Tsagkatos's user avatar
2 votes
Accepted

How to make a world map from image like in paradox games? (Java, LibGDX)

In WorldMap.draw you are reconstructing the map texture every frame by drawing a bunch of 1px by 1px rects. This is a very expensive way of drawing bitmaps, ...
Philipp's user avatar
  • 120k
2 votes

Loading the map from an image file in C++

If you want to keep things simple, I would pick a format and stick to it. The two most simplest image formats that I know of are: PPM BMP TGA It's not that difficult to implement loading of any of ...
tay10r's user avatar
  • 133

Only top scored, non community-wiki answers of a minimum length are eligible