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

113505 questions
2073
votes
41 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
  • 70,519
  • 61
  • 198
  • 274
2060
votes
33 answers

How to auto-resize an image while maintaining aspect ratio

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
  • 62,807
  • 94
  • 230
  • 350
1723
votes
37 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
  • 98,321
  • 23
  • 206
  • 194
1640
votes
38 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
  • 31,949
  • 17
  • 74
  • 114
1386
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
  • 17,941
  • 20
  • 62
  • 70
1110
votes
14 answers

How to display Base64 images in HTML

I'm having trouble displaying a Base64 image inline. How can I do it? Display Image
Christopher
  • 12,057
  • 9
  • 31
  • 37
901
votes
26 answers

CSS force image resize and keep aspect ratio

I am working with images, and I ran into a problem with aspect ratios. As you can see, height and width are already specified. I added a CSS rule for images: img { max-width:…
moonvader
  • 19,761
  • 18
  • 67
  • 116
881
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
  • 15,945
  • 6
  • 21
  • 11
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
  • 37,082
  • 20
  • 62
  • 59
725
votes
33 answers

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

Is there a JavaScript or jQuery API or method to get the dimensions of an image on the page?
Saneef
  • 8,620
  • 7
  • 29
  • 42
723
votes
27 answers

img src SVG changing the styles with CSS

html Logo css .logo-img path { fill: #000; } The above svg loads and is natively fill: #fff but when I use the above css to try change it to black it doesn't change, this is my first time playing with…
ngplayground
  • 20,365
  • 36
  • 94
  • 173
710
votes
10 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
  • 166,356
  • 226
  • 505
  • 746
700
votes
29 answers

Change color of PNG image via CSS?

Given a transparent PNG displaying a simple shape in white, is it possible to somehow change the color of this through CSS? Some kind of overlay or what not?
user429620
687
votes
22 answers

How do I display local image in markdown?

Does anyone know how to display a local image in markdown? I don't want to set up a webserver for that. I try the following in markdown, but it doesn't work: ![image](files/Users/jzhang/Desktop/Isolated.png)
zjffdu
  • 25,496
  • 45
  • 109
  • 159
675
votes
24 answers

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

Is it possible to set the src attribute value in CSS? In most cases, we use it like this: and I want it to be something like this .myClass { some-src-property:…
Rakesh Juyal
  • 35,919
  • 68
  • 173
  • 214
1
2 3
99 100