Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

51
Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006

Transcript of Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Page 1: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Dean PentcheffNHMLAC MBPC/Crustacea

17 April 2006

Page 2: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Digital Imaging

• Image types (realworld, bitmap, vector)

• Bitmap specifics• Vector specifics• Guidelines

Page 3: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Digital Imaging

• Image types (realworld, bitmap, vector)

• Bitmap specifics• Vector specifics• Guidelines

Page 4: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Image types

• Realworld – what you see around you

• Bitmap – grid of pixels (GIF, JPG, PNG, …)

• Vector – list of curves (AI, Postscript, PDF, …)

Page 5: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Image types: Realworld

• Continuous resolution

• Infinitely zoomable

• No limits on rotation

Page 6: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Image types: Bitmap

• Grid of pixels• Scaling is limited

• Examples:– JPG/JPEG– GIF– PNG– BMP– TIF/TIFF

Page 7: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Image types: Vector

• List of curve and shape postions

• Infinitely scalable

• Examples:– Adobe Illustrator– Postscript– PDF

Page 8: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Digital Imaging

• Image types (realworld, bitmap, vector)

• Bitmap specifics• Vector specifics• Guidelines

Page 9: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Grid of pixels

A bitmap is a list of colors, each corresponding to a dot on a grid

Page 10: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Pixel dimensions

• Bitmaps are best considered as a grid of dots (“pixels”)

• Every bitmap has a width (X dimension) and length (Y dimension)

• A bitmap has no intrinsic size (except in pixels)

• So what is resolution?

width: 30 pixels

height: 22 pixels

Page 11: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Resolution and DPI

• How big is it on the screen or on the page?– how many pixels per inch (dots per inch = DPI)?

• Sizes: – screens ≈ 72 pixels per inch (DPI)– printing ≈ 300 – 1200 pixels per inch (DPI)

• But remember: you have a limited bag of pixels

size only matters at final rendering

Page 12: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Resolution and DPI

• Example image: 30 pixels wide x 22 pixels high– how wide will that be on screen (72 dots per inch)?

width of image x ( 1 inch / 72 dots)

= 30 pixels x ( 1 inch / 72 pixels )= 0.4 inches

• And the result is?

Page 13: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Resolution and DPI

• What about making it bigger with a lower DPI?– example: put it on a billboard– how wide will that be (10 dots per inch)?

width of image x ( 1 inch / 10 dots)= 30 pixels x ( 1 inch / 10 pixels

)= 3 inches

• Notice that there’s no more information

Page 14: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Scaling and rotation

• Implications of the grid– scaling a picture means sampling the image and synthesizing a new grid of pixels

– rotation similarly means sampling and resynthesizing the grid

• Why does the grid of pixels have to be sampled and resynthesized?

Page 15: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Scaling example

Page 16: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Scaling example

• To rescale, new pixels have to by synthesized by interpolation from the original pixels

• Minor rescale – 29 pixels wide (from 30 pixels original)

Page 17: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Rotation example

• Same situation: new pixels have to be synthesized by interpolation from the original pixels

• Similarly small rotation – 3 degrees

Page 18: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Scaling and rotation

• Scaled or rotated images will be blurrier

• Avoid rescaling/rotating if you can

• If you have to do it, do it after any other manipulations or image enhancements

Page 19: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Color formats

• Common versions of bitmaps– RGB (red, green, blue) color – monitors/Web

– CMYK (cyan, magenta, yellow, black) – commercial printing

• How are colors represented?– looking at RGB…

Page 20: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: RGB colors

• Usually 24-bit color– 3 numbers (one each for red, green, blue)

– each between 0-25510 (8 bits)

• Representations– red,green,blue as decimals: 255,0,0 0,0,255 127,0,127 255,127,0 100,50,0

– #rrggbb as hexadecimals: #ff0000 #0000ff #800080 #ff8000 #643200

Page 21: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Color modes

• “Truecolor”– 24 bits per pixel

• Indexed– 8 or 12 bits per pixel, which select one of a limited palette of colors

• Grayscale– Similar to color, but only one channel

Page 22: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Storage and compression

• On disk, bitmaps are a string of numbers• To save space, compression is used• Lossless compression – every pixel preserved– PNG, GIF, TIFF

• Lossy compression – some information lost– JPG (efficient and effective for photographic images only – not for line art)

Page 23: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Storage and compression

• Example of JPG over-compression

Page 24: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Image sources

• Original (digital) photographs and SEMs

• Photos and SEMs scanned from printed material

• Original digital art (Photoshop-created)

Page 25: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Original photos & SEMs

• Recall the scaling/rotating issues

• Since the target is (usually) a bitmap, there’s not too much to be said here…

Page 26: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Scanned photos & SEMs

• Printing does violence to images

• When scanning, we need to recover the original qualities of a digital image

Page 27: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Scanned photos & SEMs

Page 28: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Scanned photos & SEMs

Page 29: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Scanned photos & SEMs

• Naïve rescaling leads to trouble:

Moiré distortionoriginal very close up

Page 30: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Scanned photos & SEMs

• To avoid Moiré problems:– scan at high resolutions (600 – 1200 DPI)

– blur the image until the dots just disappear

– scale image down to a reasonable size

Page 31: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Scanned photos & SEMs

Photoshop start

Make sure

you’re

seeing

the full

resolutio

n on the

screen

Set up

Gaussian

Blur

Not enough blur Too much blur Just about right

Page 32: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Scanned photos & SEMs

Naïve rescaling Better rescaling

Page 33: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Original digital art

• Created in Photoshop or similar program

• Like original photos, observe scaling issues

Page 34: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Bitmaps: Summarizing

• Bitmaps are a bag of pixels with no intrinsic size(“dots per inch” and “resolution” matter only to a final output device)

• Scaling and rotating mean resynthesizing the grid of pixels (hence blurring)

• Scanned photographs need special care

Page 35: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Digital Imaging

• Image types (realworld, bitmap, vector)

• Bitmap specifics• Vector specifics• Guidelines

Page 36: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Vector images: Lines and shapes

• Reminder: vector images are descriptions of line and shape positions and sizes

• Hence they can be scaled to any size with no loss of information or resampling

• Examples:Adobe Illustrator, Postscript, PDF

Page 37: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Vector images: Lines and shapes

Page 38: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Vector images: scaling & rotating

• There is no loss of information or resynthesizing when a vector image is scaled or rotated

• Programs may save a “target” size or page size with the vectors – but that doesn’t constrain scaling

Page 39: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Vector images: With bitmaps

• Vector graphic formats can contain bitmaps (e.g. photos in a PDF or a scan of a microscope sketch in Illustrator)

• Those contained bitmaps have all the properties of bitmap images: rescaling & rotating imply resynthesizing the grid of pixels

Page 40: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Vector images: Storage

• Always lossless• Numbers and shape descriptions

• Very compact, vs. bitmaps

.8 setgrayclippath fill-110 -300 translate1.1 dup scale

0 g0 G0 i0 J0 j0.172 w10 M[]0 d0 0 0 0 k

177.696 715.715 m177.797 713.821 176.973 713.84 v176.149 713.859 159.695 761.934

139.167 759.691 C156.95 767.044 177.696 715.715 Vb181.226 718.738 m180.677 716.922 179.908 717.221 v179.14 717.519 180.023 768.325

159.957 773.199 C179.18 774.063 181.226 718.738 Vb

Page 41: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Vector images: Rendering

• Vector images are descriptions of lines

• Display devices are bitmapped (screens, printers, etc.)

• Converting the geometric descriptions into an output bitmap is “rendering”

Page 42: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Vector images: Rendering

Page 43: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Vector images: Rendering

• How rendering is done depends on the output device– resolution

screen ≈ 72 DPI, printer ≈ 300–1200

– sizenumber of pixels = size x DPI

– color or B&W

• Hence rendering may differ for printed paper, screen, PDF, etc.

Page 44: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Digital Imaging

• Image types (realworld, bitmap, vector)

• Bitmap specifics• Vector specifics• Guidelines

Page 45: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Guidelines

• Original digital photos and SEMs

– Save original highest-resolution copy

– Manipulate (contrast-enhance, etc.) first, then scale or rotate

– Use JPG at quality “8 / High” for most purposes

Page 46: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Guidelines• Scanned photos and SEMs

– scan at fairly high resolution (600–1200 DPI)

– use Photoshop to blur just until print-dots disappear

– save that “original” as PNG for archival purposes

– save as JPG (quality “8/High”) for most usage

Page 47: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Guidelines

• Bitmap sizes– monitors and laptops are about this size:

small: 1024 wide x 768 highlarge: 1680 wide x 1050 high

•so to cover 1/3 to 1/2 screen width:make bitmaps about 300–600 pixels wide

– printers are 300–1200 DPI and 8.5 inches wide•print software will rescale images•for good resolution, use bitmaps ≥ 1000 pixels wide

Page 48: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.

Questions problems comments answers…

Page 49: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.
Page 50: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.
Page 51: Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.