Hot answers tagged

9

JPEG compression involves three main steps: Chroma subsampling. The image is converted from RGB into YCbCr color space, in which the luma or brightness (Y) is stored separately from the chroma or color components, Cb and Cr. The Y component is kept at full resolution, but Cb and Cr are downsampled, typically to half resolution on each axis. This exploits ...


9

It seems like you're asking two things. I can't really speak technically about JBU, but I can give an overview of the necessary concepts and bilateral filtering generally. You'll probably need to find more details yourself, but this should give a coherent structure to start from. Fixing "Image"s Many image-processing people view filtering as either ...


8

Neither of your suggestions is a solution for crisp 2D graphics at all resolutions. SVGs are great and infinitely scalable, but since you don't know where the pixel boundaries will lie in the final render, you can't get crisp edges at all resolutions. For example, say your GUI is a red box on a green background. If the edge between the red and the green ...


7

You're confusing the screen (the physical display) with the framebuffer (the memory which gets read out by the display controller). The framebuffer might get cleared at the start of each frame period, but that doesn't change the display. The order of events is as follows: At the start of a new frame, glClear or equivalent sets the framebuffer to the clear ...


7

OpenEXR might be a good fit. You can have an arbitrary number of channels per pixel and the data types for each channel can be integers. http://www.openexr.com/


7

ImageMagick is a set of command-line tools that can do the sort of things you describe. For example, this command line will overlay picture B with a centered copy of picture A, resized to 100 pixels wide (keeping aspect ratio): convert pictureB.png ( pictureA.png -resize 100 ) -gravity center -composite output.png See the ImageMagick docs for more info ...


5

The missing step If you already understand how to generate a secondary ray, then you have already grasped the difficult part. All you need to do now is find the colour that this secondary ray results in. This is exactly the same process as using the primary ray to find a colour, in basic ray tracing. After repeating this for a large number of secondary ...


5

To make it a more complete example, let's also consider loading a texture from a BufferedImage as well. First let's assume: int texture = glGenTextures(); glBindTexture(GL_TEXTURE_2D, texture); First we need to load an image. For this we can use ImageIO.read(). Then we put all the pixels from the BufferedImage into a ByteBuffer. BufferedImage image = ...


4

It's called trilinear interpolation. You first do a bilinear interpolation of the higher-res texture, then do a bilinear interpolation on the lower-res texture, then interpolate between the 2 results. The weight of the final interpolation is based on where between the 2 textures your Z-coordinate falls. If 0 is fully the low-res texture and 1 is fully the ...


3

This probably does not explore the full depth of the term, but the first thing that comes to my mind when I hear "bilateral upsampling" is depth-aware blending of low-resolution images onto high-resolution ones; for instance, when you render alpha-blended geometry to a half-resolution buffer (for performance savings) and then composite it back onto the main ...


3

If the pieces are fairly close to where they were, ICP could be of help (under the assumption that the pieces are planar polygons).


3

Each channel ranges not from black to white, but from off to full intensity. What colour is meant by full intensity is down to convention and the presentation technology. For example, a given image file format might say there are three bytes, of which the first is the red channel, the second is the green channel, and the third is the blue channel. There are ...


3

Depends if you are talking about CPU or GPU ray tracer. For CPU you generally simply allocate an array of width * height float4's (i.e. for RGB & alpha) and for GPU you allocate a texture (e.g. R16G16B16A16F or R32G32B32A32F format). It depends on your case if you really need the alpha though. The target on CPU is then simply accessed by image[(x+y*width)...


3

It doesn't matter. All that matters is that you can store information per pixel. In most cases this means allocating a x*y array of ints (for 3 byte-sized channels of RGB) to store the pixel values and then feed it into your image compression library of choice to save it out to disk.


3

In an EXR, the convention is to store associated alpha, also known as premultiplied. The latter term however doesn't do justice to the nuances of the alpha format as compared to its evil distant cousin known as unassociated alpha, aka straight or key alpha. In an associated alpha image, two facets are represented via the RGB triplet and its associated alpha ...


3

Elaboration on temporal solve: I don't have much concrete info for you, but I'm drawing from the idea of "temporal anti aliasing". Basically, if a camera was stationary, you could average pixel values over the last N frames, possibly using harmonic mean or something else like that to help filter out spikes. The result would be a cleaner, less noisy, more ...


2

Probably .dds. You can store there textures array or 3d texture both can be use as array per pixel. You can try creating this textures with DxTex from DirecX SDK. Also you can look in Legacy Texture Tools from Nvidia https://developer.nvidia.com/legacy-texture-tools


2

If you scale an image down to a screen that has a lower resolution than yout image, you have to descide what you do, there is no single way of doing this. There are many different techniques that yield very different results. This is very similar to displaying a low resolution image on a high resolution display where do the inverse thing by desciding how to ...


2

A fairly basic but effective technique is median filtering. For video, you can apply it (spatio)temporally by replacing the value of each pixel in each frame by the median of the values of the pixel (and its neighbors) in the current and the N previous and later frames. A nice feature of median filtering is that it preserves linear edges (and, when used ...


2

You might find the 1983 paper that introduced this**, i.e. Lance Williams' "Pyramidal Parametrics" informative. You can ignore the scheme, in Figure 1, he used for the layout of the MIP maps as I doubt any hardware, at least in the last 20+ years, used that approach. ** (Actually, Williams *may* have described the technique at an earlier SIGGRAPH (1981) ...


2

PNG format is lossless format where for compression the image is first "filtered" and this filtered image is then passed to DEFLATE lossless compression algorithm. The purpose of filtering stage is to make the image more compressible by DEFLATE and current method uses delta-compression from previously decoded pixels. So if your plan is to pre-process the ...


2

Starting from reading the data from a file to displaying the image on the screen. As was pointed out in the comments, this is an extremely broad question, and depends on what operating system you're using, and which tool sets for that OS you're using. That said, I think it is possible to talk generally about the process with much of it (if not all) being ...


1

I think your answer is a little off. When the saturation is 0, the hue is basically undefined. It has some numerical value, but that value is ignored. Saturation of 0 means achromatic, or uncolored. So it can only be a shade of gray. Saturation is unrelated to value in HSV. You can have all of the following: dark unsaturated colors (basically dark grays ...


1

CRT monitors are a thing of the past, but I think they are the best example to describe to you "how the image is formed". Each pixel on the monitor is actually a group of 3 phosphors. A green phosphor, a red phosphor and a blue phosphor. These phosphors will glow at a certain intensity when they are charged. Inside the monitor there is an electron beam that ...


1

Yes, most formats work this way! For example JPEG can be decoded up to the point where the chunks are available: Image 1 Scaled version of original JPEG picture at (1 048 198 bytes) and corrupted one (610 922 bytes) side by side. Original image by Maruf Mostafa image available here This is easy for you to test take an image and just simply delete some ...


1

I figured it out myself, again: just add glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); behind the glTexImage2D command and it works as intended.


1

First off, it's worth noting that not all artefacts are regions of the same colour. Artefacts just means structured errors introduced by the compression, as opposed to noise or blurring. JPEG artefacts include flattened colours as you mention, but also edges introduced at block boundaries, and "ringing" around sharp edges in the image. There are two popular ...


1

"Cropping an image" means some part of the image is removed in order for the image to fit a certain size. For example, removing the rightmost part of a rectangular image can result in a square. "Resizing an image" usually means to stretch and squeeze it as needed so it fits a given size. Width and height are modified independently. If the ratio between them ...


1

I've used imageStore as part of compute shaders doing surface extraction. I've only ever used it in compute shaders, to store the calculated data in a texture to be consumed by another shader - I know it's possible to do imageStore in a fragment shader as well but I haven't come across a use case for it yet. I also haven't used imageLoad at all, since ...


1

Do you use MFC? If so, here's a code snippet to write a red gradient image using MFC's CImage. The top of the image is redder. Because height is positive, it's a bottom-up DIB and higher values of y (in GetPixelAddress()) point to earlier scanlines (i.e. lower in the image): const unsigned int imageWidth = 100; const unsigned int imageHeight = 255; ...


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