Questions tagged [image]

The image tag is for questions related to the loading, formatting, saving, compression, and display of images in the context of source code. This tag should also be used for assistance using various image libraries. Questions about specific image formats should include the tags for those formats. Include tags to mention if the question relates to format conversion, processing, etc.

The image tag is for questions related to the loading, formatting, saving, compression, and display of images in the context of source code. Images are typically rendered as a two dimensional matrix of pixels for the case of gray-scale images, or a multidimensional matrix of pixels in the case of color images (, , etc). These may be stored in a variety of formats such as , , , , , and others (See Image file formats for further information).

Where appropriate, include tags that classify the type of question, such as , , etc.


References

105595 questions
2001
votes
40 answers

How to lazy load images in ListView in Android

I am using a ListView to display some images and captions associated with those images. I am getting the images from the Internet. Is there a way to lazy load images so while the text displays, the UI is not blocked and images are displayed as they…
lostInTransit
  • 68,087
  • 58
  • 193
  • 270
1746
votes
37 answers

How do I auto-resize an image to fit a 'div' container?

How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining its width:height ratio? Example: stackoverflow.com - when an image is inserted onto the editor panel and the image is too large to fit…
001
  • 55,049
  • 82
  • 210
  • 324
1597
votes
36 answers

How to vertically align an image inside a div

How can you align an image inside of a containing div? Example In my example, I need to vertically center the in the
with class ="frame":
Arnaud Le Blanc
  • 90,979
  • 22
  • 192
  • 188
1335
votes
44 answers

Strange OutOfMemory issue while loading an image to a Bitmap object

I have a ListView with a couple of image buttons on each row. When the user clicks the list row, it launches a new activity. I have had to build my own tabs because of an issue with the camera layout. The activity that gets launched for the result…
Chrispix
  • 16,821
  • 19
  • 60
  • 68
1178
votes
31 answers

Changing image size in Markdown

I just got started with Markdown. I love it, but there is one thing bugging me: How can I change the size of an image using Markdown? The documentation only gives the following suggestion for an image: ![drawing](drawing.jpg) If it is possible I…
cantdutchthis
  • 24,764
  • 14
  • 64
  • 105
819
votes
17 answers

Changing the image source using jQuery

My DOM looks like this:
When someone clicks on an image, I want the image src to change to…
user67033
  • 14,995
  • 6
  • 19
  • 11
795
votes
12 answers

How to display Base64 images in HTML?

I'm having trouble displaying a Base64 image inline. Can someone point me in the right direction? Display Image
Christopher
  • 8,739
  • 8
  • 28
  • 37
777
votes
31 answers

When to use IMG vs. CSS background-image?

In what situations is it more appropriate to use an HTML IMG tag to display an image, as opposed to a CSS background-image, and vice-versa? Factors may include accessibility, browser support, dynamic content, or any kind of technical limits or…
system PAUSE
  • 33,478
  • 18
  • 60
  • 59
680
votes
24 answers

CSS force image resize and keep aspect ratio

I am working with images, and I ran across a problem with aspect ratios. As you can see, height and width are already specified. I added CSS rule for images: img { …
moonvader
  • 13,845
  • 14
  • 51
  • 93
666
votes
32 answers

How to get image size (height & width) using JavaScript?

Are there any JavaScript or jQuery APIs or methods to get the dimensions of an image on the page?
Saneef
  • 8,013
  • 7
  • 27
  • 42
631
votes
25 answers

Convert an image to grayscale in HTML/CSS

Is there a simple way to display a color bitmap in grayscale with just HTML/CSS? It doesn't need to be IE-compatible (and I imagine it won't be) -- if it works in FF3 and/or Sf3, that's good enough for me. I know I can do it with both SVG and…
Ken
  • 6,712
  • 3
  • 16
  • 8
591
votes
13 answers

What are the different usecases of PNG vs. GIF vs. JPEG vs. SVG?

When should certain image file types be used when building websites or interfaces, etc? What are their points of strength and weakness? I know that PNG & GIF are lossless, while JPEG is lossy. But what is the main difference between PNG & GIF? Why…
Faruz
  • 9,691
  • 10
  • 44
  • 65
590
votes
25 answers

Is it possible to set the equivalent of a src attribute of an img tag in CSS?

Is it possible to set the src attribute value in CSS? At present, what I am doing is: and I want it to be something like this .myClass { some-src-property: url("pathTo/myImage.jpg"); I…
Rakesh Juyal
  • 33,043
  • 66
  • 165
  • 212
585
votes
9 answers

Image inside div has extra space below the image

Why in the following code the height of the div is bigger than the height of the img ? There is a gap below the image, but it doesn't seems to be a padding/margin. What is the gap or extra space below image? #wrapper { border: 1px solid red; …
Misha Moroshko
  • 148,413
  • 200
  • 467
  • 700
571
votes
20 answers

How to make layout with rounded corners..?

How can I make a layout with rounded corners? I want to apply rounded corners to my LinearLayout.
Addy
  • 5,735
  • 3
  • 12
  • 13
1
2 3
99 100