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
154
votes
23 answers

How do I get the height and width of the Android Navigation Bar programmatically?

The black navigation bar on the bottom of the screen is not easily removable in Android. It has been part of Android since 3.0 as a replacement for hardware buttons. Here is a picture: How can I get the size of the width and the height of this UI…
Kevik
  • 9,181
  • 19
  • 92
  • 148
148
votes
19 answers

Generate colors between red and green for a power meter?

I'm writing a Java game and I want to implement a power meter for how hard you are going to shoot something. I need to write a function that takes a int between 0 - 100, and based on how high that number is, it will return a color between Green (0…
mmcdole
  • 91,488
  • 60
  • 186
  • 222
148
votes
20 answers

Algorithm to detect intersection of two rectangles?

I'm looking for an algorithm to detect if two rectangles intersect (one at an arbitrary angle, the other with only vertical/horizontal lines). Testing if a corner of one is in the other ALMOST works. It fails if the rectangles form a cross-like…
user20493
  • 5,704
  • 7
  • 34
  • 31
145
votes
6 answers

What does glLoadIdentity() do in OpenGL?

I'm new to OpenGL and I'm a little overwhelmed with all of the random functions that I have in my code. They work and I know when to use them, but I don't know why I need them or what they actually do. I know that glLoadIdentity() replaces the…
Alexander
  • 3,037
  • 6
  • 24
  • 17
130
votes
15 answers

Pretty graphs and charts in Python

What are the available libraries for creating pretty charts and graphs in a Python application?
sverrejoh
  • 16,464
  • 13
  • 41
  • 29
128
votes
2 answers

What are the practical differences when working with colors in a linear vs. a non-linear RGB space?

What is the basic property of a linear RGB space and what is the fundamental property of a non-linear one? When talking about the values inside each channel in those 8 (or more) bits, what changes? In OpenGL, colors are 3+1 values, and with this i…
Ken
  • 2,105
  • 3
  • 19
  • 22
126
votes
6 answers

Android: Background Image Size (in Pixel) which Support All Devices

I am creating an Application which will run on all Android Devices. I want to create xhdpi Graphics for My App. My App is full screen. I am confused in Creating graphics. can any one tell me the best sizes of my background image in pixels. For…
Ahmed Nawaz
  • 1,271
  • 2
  • 9
  • 4
124
votes
8 answers

opengl: glFlush() vs. glFinish()

I'm having trouble distinguishing the practical difference between calling glFlush() and glFinish(). The docs say that glFlush() and glFinish() will push all buffered operations to OpenGL so that one can be assured they will all be executed, the…
jay.lee
  • 19,388
  • 8
  • 39
  • 38
121
votes
19 answers

How to crop circular area from bitmap in Android

I have a bitmap and I want to crop a circular region from this bitmap. All pixels outside the circle should be transparent. How can I do this?
Altaf
  • 5,150
  • 10
  • 39
  • 55
120
votes
8 answers

How can I set the matplotlib 'backend'?

I am new user of matplotlib, my platform is Ubuntu 10.04 Python 2.6.5 This is my code import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.plot([1,2,3]) The error…
user504909
  • 9,119
  • 12
  • 60
  • 109
118
votes
4 answers

Remove facet_wrap labels completely

I'd like to remove the labels for the facets completely to create a sort of sparkline effect, as for the audience the labels are irrelevant, the best I can come up with is: library(MASS) library(ggplot2) qplot(week,y,data=bacteria,group=ID,…
Sean
  • 3,765
  • 3
  • 26
  • 48
109
votes
6 answers

Can I run CUDA on Intel's integrated graphics processor?

I have a very simple Toshiba Laptop with i3 processor. Also, I do not have any expensive graphics card. In the display settings, I see Intel(HD) Graphics as display adapter. I am planning to learn some cuda programming. But, I am not sure, if I can…
Ankit
  • 6,772
  • 11
  • 48
  • 84
106
votes
4 answers

Difference between surface and texture (SDL / general)

Can anyone explain to me in simple words what is the difference between texture and surface? I saw it used in SDL2 as SDL_Surface and SDL_Texture. SDL_Textureis created from SDL_Surface which in turn is created from image/bitmap. Both are collection…
ps-aux
  • 11,627
  • 25
  • 81
  • 128
102
votes
6 answers

How to set shape's opacity?

I already know how to set the opacity of the background image but I need to set the opacity of my shape object. In my Android app, I have it like this: and I want to make this black area a bit transparent, like here, for example I can see circles…
lomza
  • 9,412
  • 15
  • 70
  • 85
98
votes
6 answers

An algorithm to space out overlapping rectangles?

This problem actually deals with roll-overs, I'll just generalized below as such: I have a 2D view, and I have a number of rectangles within an area on the screen. How do I spread out those boxes such that they don't overlap each other, but only…
Extrakun
  • 19,057
  • 21
  • 82
  • 129