Questions tagged [imaging]

Anything related to digital imaging, i.e. the theory, the technology and the techniques about acquiring, representing, processing and rendering digital images. This is a term with a rather broad meaning: consider using a more specific tag if it applies to your use case (e.g. use [image-processing] tag if the question is specifically about processing and not rendering).

Anything related to digital imaging, i.e. the theory, the technology and the techniques about acquiring, representing, processing and rendering digital images. This is a term with a rather broad meaning: consider using a more specific tag if it applies to your use case (e.g. use tag if the question is specifically about processing but not about rendering).

468 questions
138
votes
9 answers

How does Google's Page Speed lossless image compression work?

When you run Google's PageSpeed plugin for Firebug/Firefox on a website it will suggest cases where an image can be losslessly compressed, and provide a link to download this smaller image. For example: Losslessly compressing…
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
85
votes
16 answers

ImportError: cannot import name _imaging

I installed Pillow, and after I want to do: from PIL import Image I get the following error: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 61, in…
tomooka
  • 1,091
  • 2
  • 9
  • 12
83
votes
5 answers

Image Processing: What are occlusions?

I'm developing an image processing project and I come across the word occlusion in many scientific papers, what do occlusions mean in the context of image processing? The dictionary is only giving a general definition. Can anyone describe them using…
76
votes
3 answers

Scaling a System.Drawing.Bitmap to a given size while maintaining aspect ratio

I want to scale a System.Drawing.Bitmap to at least less than some fixed width and height. This is to generate thumbnails for an image gallery on a website, so I want to keep the aspect ratio the same. I have some across quite a few solutions but…
Michael J. Gray
  • 9,784
  • 6
  • 38
  • 67
51
votes
1 answer

What is the definition of a "disparity map"?

I've been asked to implement an edge-based disparity map, but I fundamentally don't understand what a disparity map is. What is the definition of a "disparity map"?
45
votes
6 answers

Python Imaging Library - Text rendering

I'm trying to render some text using PIL, but the result that comes out is, frankly, crap. For example, here's some text I wrote in Photoshop: and what comes out of PIL: As you can see, the results from PIL is less than satisfactory. Maybe I'm…
exiva
  • 1,247
  • 1
  • 11
  • 13
42
votes
1 answer

How to CREATE a transparent gif (or png) with PIL (python-imaging)

Trying to create a transparent gif with PIL. So far I have this: from PIL import Image img = Image.new('RGBA', (100, 100), (255, 0, 0, 0)) img.save("test.gif", "GIF", transparency=0) Everything I've found so far refers to manipulating…
gratz
  • 1,506
  • 3
  • 16
  • 34
42
votes
7 answers

How do I draw text at an angle using python's PIL?

Using Python I want to be able to draw text at different angles using PIL. For example, imagine you were drawing the number around the face of a clock. The number 3 would appear as expected whereas 12 would we drawn rotated counter-clockwise 90…
carrier
  • 32,209
  • 23
  • 76
  • 99
24
votes
2 answers

Python PIL - Draw Circle

I am trying to draw a simple circle and save this to a file using the Python Imaging Library: import Image, ImageDraw image = Image.new('RGBA', (200, 200)) draw = ImageDraw.Draw(image) draw.ellipse((20, 180, 180, 20), fill = 'blue', outline…
Rushy Panchal
  • 16,979
  • 16
  • 61
  • 94
20
votes
3 answers

How to calculate the average rgb color values of a bitmap

In my C# (3.5) application I need to get the average color values for the red, green and blue channels of a bitmap. Preferably without using an external library. Can this be done? If so, how? Thanks in advance. Trying to make things a little more…
Mats
  • 14,902
  • 33
  • 78
  • 110
18
votes
1 answer

Drawing multilingual text using PIL

I'm having trouble drawing multilingual text using PIL. Let's say I want to draw text - "ひらがな - Hiragana, 히라가나". But PIL's ImageDraw.text() function takes only one font at a time, so I cannot draw this text correctly, because it requires English,…
redism
  • 500
  • 7
  • 18
17
votes
2 answers

How to create JPEG compressed DICOM dataset using pydicom?

I am trying to create a JPEG compressed DICOM image using pydicom. A nice source material about colorful DICOM images can be found here, but it's mostly theory and C++. In the code example below I create a pale blue ellipsis inside output-raw.dcm…
mseimys
  • 588
  • 1
  • 7
  • 16
17
votes
5 answers

How can I draw a bezier curve using Python's PIL?

I'm using Python's Imaging Library and I would like to draw some bezier curves. I guess I could calculate pixel by pixel but I'm hoping there is something simpler.
carrier
  • 32,209
  • 23
  • 76
  • 99
16
votes
3 answers

DICOM Slice Ordering

I have a basic question for the DICOM protocol. I know how I can calculate the orientation labels of every slice of a DICOM image (A,P,L,R,H,F). But when I got for example an Axial slices with numbers from 0001 to 0024 I need to know if the slice…
NDY
  • 3,527
  • 4
  • 48
  • 63
15
votes
4 answers

How to check if an image contains a face and it is reasonably visible

I am not sure if this is solveable, but I though I will ask anyway. In my company we deal with massive enrollment camps where small teams of 5 to 10 people go to a village and enroll people. The enrollment involves entering some data, capturing…
Raghu
  • 1,415
  • 13
  • 18
1
2 3
31 32