Questions tagged [graphics]

Graphics are visual presentations. Questions using this tag should also be tagged with the appropriate language and graphics subsystem in use. For more general graphics questions, consider Computer Graphics Stack Exchange (computergraphics.stackexchange.com).

Graphics

The tag should be assigned to questions about constructing, displaying and manipulating visual presentations. Questions should also be tagged with the appropriate language and graphics subsystem in use. For more general graphics questions, consider Computer Graphics Stackexchange.

While historically there were two parallel developments of vector and raster (bitmap) systems, modern systems all implement the raster model at the hardware layer but may use extensive applications of vector graphics techniques at higher levels. The entire chain through the various levels to go from model to picture on screen is known as the pipeline.

The Borland Graphics Interface (graphics.h) has its own tag:

Examples

Construction:

  • How to turn raw data into a bitmap?
  • How to generate a chart, how to draw using vectors?
  • How to load a .3ds file and display the model?

Displaying

  • How to display a large bitmap scaled down?
  • How to use an image as a texture for a control?
  • How to ray-trace voxel data?

Manipulating

  • How to modify images using common effects such as filters?
  • How to create animations?

Counterexamples

  • How to draw using a paint program? --> too basic, not programming related
  • How to take a picture when there is not enough light? --> see Photography
  • How to scan a pencil drawing? --> software tools, see SuperUser
  • What graphics card should I buy? --> shopping questions are off-topic on most SE sites

Resources

Free Graphics Programming Books

20510 questions
601
votes
42 answers

How can I determine whether a 2D Point is within a Polygon?

I'm trying to create a fast 2D point inside polygon algorithm, for use in hit-testing (e.g. Polygon.contains(p:Point)). Suggestions for effective techniques would be appreciated.
398
votes
25 answers

Creating a blurring overlay view

In the Music app of the new iOS, we can see an album cover behind a view that blurs it. How can something like that be accomplished? I've read the documentation, but did not find anything there.
kondratyevdev
  • 3,569
  • 3
  • 13
  • 11
321
votes
13 answers

How do I position one image on top of another in HTML?

I'm a beginner at rails programming, attempting to show many images on a page. Some images are to lay on top of others. To make it simple, say I want a blue square, with a red square in the upper right corner of the blue square (but not tight in…
rrichter
  • 9,253
  • 5
  • 23
  • 13
278
votes
15 answers

Ball to Ball Collision - Detection and Handling

With the help of the Stack Overflow community I've written a pretty basic-but fun physics simulator. You click and drag the mouse to launch a ball. It will bounce around and eventually stop on the "floor". My next big feature I want to add in is…
mmcdole
  • 91,488
  • 60
  • 186
  • 222
226
votes
4 answers

GraphViz - How to connect subgraphs?

In the DOT language for GraphViz, I'm trying to represent a dependency diagram. I need to be able to have nodes inside a container and to be able to make nodes and/or containers dependent on other nodes and/or containers. I'm using subgraph to…
Winston Smith
  • 21,585
  • 10
  • 60
  • 75
225
votes
7 answers

Difference between SurfaceView and View?

When is it necessary, or better to use a SurfaceView instead of a View?
Viktor
  • 3,295
  • 2
  • 25
  • 26
219
votes
12 answers

How can I produce an effect similar to the iOS 7 blur view?

I'm trying to replicate this blurred background from Apple's publicly released iOS 7 example screen: This question suggests applying a CI filter to the contents below, but that's a whole different approach. It's obvious that iOS 7 doesn't capture…
Snowman
  • 31,411
  • 46
  • 180
  • 303
186
votes
13 answers

How to read the RGB value of a given pixel in Python?

If I open an image with open("image.jpg"), how can I get the RGB values of a pixel assuming I have the coordinates of the pixel? Then, how can I do the reverse of this? Starting with a blank graphic, 'write' a pixel with a certain RGB value? I would…
Josh Hunt
  • 14,225
  • 26
  • 79
  • 98
182
votes
15 answers

Most underused data visualization

Histograms and scatterplots are great methods of visualizing data and the relationship between variables, but recently I have been wondering about what visualization techniques I am missing. What do you think is the most underused type of…
Ian Fellows
  • 17,228
  • 10
  • 49
  • 63
182
votes
5 answers

Saving images in Python at a very high quality

How can I save Python plots at very high quality? That is, when I keep zooming in on the object saved in a PDF file, why isn't there any blurring? Also, what would be the best mode to save it in? png, eps? Or some other? I can't do pdf, because…
dustin
  • 4,309
  • 12
  • 57
  • 79
165
votes
3 answers

How can I extract a good quality JPEG image from a video file with ffmpeg?

Currently I am using this command to extract the images: ffmpeg -i input.mp4 output_%03d.jpeg But how can I improve the JPEG image quality?
Daniel Gartmann
  • 11,678
  • 12
  • 45
  • 60
157
votes
2 answers

What does PorterDuff.Mode mean in android graphics.What does it do?

I would like to know what PorterDuff.Mode means in android graphics. I know that it is a transfer mode. I also know, that it has attributes such as DST_IN, Multiply etc.
rogerstone
  • 7,541
  • 11
  • 53
  • 62
157
votes
6 answers

How to make graphics with transparent background in R using ggplot2?

I need to output ggplot2 graphics from R to PNG files with transparent background. Everything is ok with basic R graphics, but no transparency with ggplot2: d <- rnorm(100) #generating random data #this returns transparent…
Yuriy Petrovskiy
  • 7,888
  • 10
  • 30
  • 34
157
votes
8 answers

Measuring text height to be drawn on Canvas ( Android )

Any straight forward way to measure the height of text? The way I am doing it now is by using Paint's measureText() to get the width, then by trial and error finding a value to get an approximate height. I've also been messing around with…
Danedo
  • 2,193
  • 5
  • 29
  • 37
154
votes
4 answers

How to use Greek symbols in ggplot2?

My categories need to be named with Greek letters. I am using ggplot2, and it works beautifully with the data. Unfortunately I cannot figure out how to put those greek symbols on the x axis (at the tick marks) and also make them appear in the…
Sam
  • 7,922
  • 16
  • 47
  • 62
1
2 3
99 100