This is a beta version of migrating these workshop materials to a new platform. If you run into issues please file an issue or click on the edit link above and submit a pull request. You can use the previous version of the workshop materials as a fallback.
Here’s a visual tour of how you can extract a region and manipulate the image further.
We’ll start with the full size version of this image and crop out just the building. You can see where the architect was testing out colors, so it’d be nice to crop those out.
The resource we’ll use is Perspective from the West - Front by Henry L. Kamphoefner.
This is the URL we will end up with:
https://iiif.lib.ncsu.edu/iiif/mc00198-008-ff0051-000-001_0001/2016,2280,1884,952/500,/0/default.jpg
Let’s walk through it.
Highlighted is the portion of the URL that would be the same for all of the images delivered from the same image server.
https://iiif.lib.ncsu.edu/iiif/mc00198-008-ff0051-000-001_0001/2016,2280,1884,952⁄500,/0/default.jpg
The identifier is: mc00198-008-ff0051-000-001_0001
https://iiif.lib.ncsu.edu/iiif/mc00198-008-ff0051-000-001_0001/2016,2280,1884,952⁄500,/0/default.jpg
https://iiif.lib.ncsu.edu/iiif/mc00198-008-ff0051-000-001_0001/2016,2280,1884,952/500,/0/default.jpg
Our single xywh
parameter value is 2016,2280,1884,952
. We can break out the individual parameters like this:
parameter | value |
---|---|
x | 2016 |
y | 2280 |
w | 1884 |
h | 952 |
To get the x
position we count over 2016 pixels.
We then go down from the top by 2280 pixels to get the y
position.
What we’re really doing is selecting the xy
point on the image.
From that xy point we measure out the width in pixels.
Finally from the xy point we measure out the height in pixels.
Here’s the region we’ve selected from the full image based on our xywh
parameters.
That’s still quite a large image so we can scale the image down. In this case the image is scaled down to 500 pixels and the height is scaled proportionally. We’ll see other examples of possible size values in the next section.
https://iiif.lib.ncsu.edu/iiif/mc00198-008-ff0051-000-001_0001/2016,2280,1884,952/500,/0/default.jpg
Let’s say we wanted to rotate the image 180 degrees. Our URL would look like this:
We requested the default quality through. We could also ask for a gray version:
https://iiif.lib.ncsu.edu/iiif/mc00198-008-ff0051-000-001_0001/2016,2280,1884,952⁄500,/0/gray.jpg
We request a JPEG image: