Cropping and Floating

Cropping and floating are complementary actions: cropping involves copying part of an old image to a new one, whereas floating involves copying all of an old image into a new and larger one. In both operations, the new image differs in size from the old one.

To crop, you must determine the minimum and maximum values on the x-axis and the minimum and maximum values on the y-axis that define the area you wish to copy into the cropped image. Here is a simple procedure for cropping the image old (0 TO xmax, 0 TO ymax) given the cropping points minx, maxx, miny, and maxy. The procedure assumes that these points lie inside the old image.

PROCEDURE CROP (minx, maxx, miny, maxy) xmax = maxx - minx ymax = maxy - miny

REDIMENSION new (0 TO xmax, 0 TO ymax)

Original Image

Original Image

Cropped Image

Floated Image

Cropped Image

Floated Image

Figure 12.7 Got too much image? Or not enough? Cropping removes edges, clipping away edge artifacts and directing the attention of viewers to specific features that you want them to notice. Floating adds extra rows and columns so that you can rotate or scale without losing the corners of your images.

FOR y = 0 to ymax FOR x = 0 TO xmax new(x, y) = old(x + minx, y + miny) NEXT x NEXT y

Was this article helpful?

0 0
Telescopes Mastery

Telescopes Mastery

Through this ebook, you are going to learn what you will need to know all about the telescopes that can provide a fun and rewarding hobby for you and your family!

Get My Free Ebook


Post a comment