# data[].attributes.body
Supposedly 'zoom enhance' was just a myth - Google says otherwise - try writing this algorithm!

# data[].attributes.attachment_link.readable_text
Google Brain has devised some new software that can create detailed images from tiny, pixelated source images. Google's software, in short, basically means the "zoom in... now enhance!" TV trope is actually possible.

First, take a look at the image on the right. The left column contains the pixelated 8×8 source images, and the centre column shows the images that Google Brain's software was able to create from those source images. For comparison, the real images are shown in the right column. As you can see, the software seemingly extracts an amazing amount of detail from just 64 source pixels.

Of course, as we all know, it's impossible to create more detail than there is in the source image-so how does Google Brain do it? With a clever combination of two neural networks.

The first part, the conditioning network, tries to map the the 8×8 source image against other high resolution images. It downsizes other high-res images to 8×8 and tries to make a match.

The second part, the prior network, uses an implementation of PixelCNN to try and add realistic high-resolution details to the 8×8 source image. Basically, the prior network ingests a large number of high-res real images-of celebrities and bedrooms in this case. Then, when the source image is upscaled, it tries to add new pixels that match what it "knows" about that class of image. For example, if there's a brown pixel towards the top of the image, the prior network might identify that as an eyebrow: so, when the image is scaled up, it might fill in the gaps with an eyebrow-shaped collection of brown pixels.

To create the final super-resolution image, the outputs from the two neural networks are mashed together. The end result usually contains the plausible addition of new details.

Google Brain's super-resolution technique was reasonably successful in real-world testing. When human observers were shown a real high-resolution celebrity face vs. the upscaled computed image, they were fooled 10 percent of the time (50 percent would be a perfect score). For the bedroom images, 28 percent of humans were fooled by the computed image. Both scores are much more impressive than normal bicubic scaling, which fooled no human observers.

It's important to note that the computed super-resolution image is not real. The added details-known as "hallucinations" in image processing jargon-are a best guess and nothing more. This raises some intriguing issues, especially in the realms of surveillance and forensics. This technique could take a blurry image of a suspect and add more detail-zoom! enhance!-but it wouldn't actually be a real photo of the suspect. It might very well help the police find the suspect, though.

Google Brain and DeepMind are two of Alphabet's deep learning research arms. The former has published some interesting research recently, such as two AIs creating their own cryptographic algorithm; the latter, of course, was thrust into the limelight last year when its AlphaGo AI defeated the world's best Go players.

DOI: arXiv:1702.00783 ( About DOIs).

# data[].attributes.attachment_link.title
Google Brain super-resolution image tech makes "zoom, enhance!" real

# data[].attributes.attachment_link.description
Google Brain has devised some new software that can create detailed images from tiny, pixelated source images. Google's software, in short, basically means the "zoom in... now enhance!" TV trope is actually possible. First, take a look at the image on the right.

# data[].attributes.body
If you make any mistakes that look cool, post them here.

# data[].attributes.body
Create or manipulate an image that has an alpha channel and hence has transparency.

# data[].attributes.attachment_link.description
In computer graphics, alpha compositing is the process of combining an image with a background to create the appearance of partial or full transparency. It is often useful to render image elements in separate passes, and then combine the resulting multiple 2D images into a single, final image called the composite.

# data[].attributes.body
Interesting video, perhaps some inspiration can be found within. Dr Mike Pound has made many more
videos on Computerphile about images and how they work.

# data[].attributes.attachment_link.title
How Blurs & Filters Work - Computerphile

# data[].attributes.attachment_link.description
Image filters make most people think of Instagram or Camera Phone apps, but what's really going on at pixel level? Image Analyst Dr Mike Pound explains some of the most common filters. Secrets Hidden in Images (Steganography): https://youtu.be/TWEXCYQKyDc JPEG 'files' & Colour: https://youtu.be/n_uNPbdenRs The Dress: https://youtu.be/Tw0PlGpaqy4 The VR Cave: https://youtu.be/STMcWUtQr1Y JPEG Discrete Cosine Transform (DCT): https://youtu.be/Q2aEzeMDHMA http://www.facebook.com/computerphile https://twitter.com/computer_phile This video was filmed and edited by Sean Riley.

# data[].attributes.body
Visit this link to find out more about the Pillow library

# data[].attributes.attachment_link.title
Pillow - Pillow (PIL Fork) 5.1.1 documentation

# data[].attributes.attachment_link.description
Pillow is the friendly PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors.

# data[].attributes.body
Swap the R and B values in each tuple and see what affect it has on the image e.g. (155,76,40) would become (40,76,155)

# data[].attributes.body
Figure out how many of the exact same colour is held within an image

# data[].attributes.body
Write an algorithm that creates images of different dimensions (not just squares).

# data[].attributes.body
This article gives detail of 3 different calculations to convert an RGB image to black & white.

# data[].attributes.attachment_link.readable_text
How do you convert a color image to grayscale? If each color pixel is described by a triple (R, G, B) of intensities for red, green, and blue, how do you map that to a single number giving a grayscale value? The GIMP image software has three algorithms.

The lightness method averages the most prominent and least prominent colors: (max(R, G, B) + min(R, G, B)) / 2.

The average method simply averages the values: (R + G + B) / 3.

The luminosity method is a more sophisticated version of the average method. It also averages the values, but it forms a weighted average to account for human perception. We're more sensitive to green than other colors, so green is weighted most heavily. The formula for luminosity is 0.21 R + 0.72 G + 0.07 B.

The example sunflower images below come from the GIMP documentation.

Original image

Lightness

Average

Luminosity

The lightness method tends to reduce contrast. The luminosity method works best overall and is the default method used if you ask GIMP to change an image from RGB to grayscale from the Image -> Mode menu. However, some images look better using one of the other algorithms. And sometimes the three methods produce very similar results.

Update: See More on colors and grayscale for more details and more examples.

# data[].attributes.attachment_link.description
How do you convert a color image to grayscale? If each color pixel is described by a triple (R, G, B) of intensities for red, green, and blue, how do you map that to a single number giving a grayscale value?

# data[].attributes.body
Check out these built-in filters from the Pillow library

# data[].attributes.attachment_link.readable_text
5 - Image Processing

With Pillow, you can easily apply common image filters: blur, emboss, sharpen, etc. Just import the ImageFilter module:

from PIL import Image
from PIL import ImageFilter

im0 = Image.open(img_filename)

#im = im0.filter(ImageFilter.BLUR)
#im = im0.filter(ImageFilter.CONTOUR)
#im = im0.filter(ImageFilter.DETAIL)
#im = im0.filter(ImageFilter.EDGE_ENHANCE)
#im = im0.filter(ImageFilter.EDGE_ENHANCE_MORE)
im = im0.filter(ImageFilter.EMBOSS)
#im = im0.filter(ImageFilter.FIND_EDGES)
#im = im0.filter(ImageFilter.SMOOTH)
#im = im0.filter(ImageFilter.SMOOTH_MORE)
#im = im0.filter(ImageFilter.SHARPEN)

This code sample gives us the opportunity to show how to convert the image data to a format suitable for fast texture update. The Pillow image object has a function called tostring() that returns a kind of raw buffer containing the pixmap. GLSL Hacker uses this raw buffer to update its OpenGL textures like shown in the following code snippet:

tex01 = moon3d.image.create2dRgbU8(imageW, imageH)
moon3d.image.updatePixmap(tex01, im.tostring())

The full demo is available in moon3d/gl-210-python-pil-pillow/pillow_image_processing.xml. Just load it in GLSL Hacker and you should have:

ImageFilter.EMBOSS

# data[].attributes.attachment_link.title
Beginning with Pillow, the PIL Fork (Python Imaging Library)

# data[].attributes.attachment_link.description
With Pillow, you can easily apply common image filters: blur, emboss, sharpen, etc. Just import the ImageFilter module: from PIL import Image from PIL import ImageFilter im0 = Image.open(img_filename) #im = im0.filter(ImageFilter.BLUR) #im = im0.filter(ImageFilter.CONTOUR) #im = im0.filter(ImageFilter.DETAIL) #im = im0.filter(ImageFilter.EDGE_ENHANCE) #im = im0.filter(ImageFilter.EDGE_ENHANCE_MORE) im = im0.filter(ImageFilter.EMBOSS) #im = im0.filter(ImageFilter.FIND_EDGES) #im = im0.filter(ImageFilter.SMOOTH) #im = im0.filter(ImageFilter.SMOOTH_MORE) #im = im0.filter(ImageFilter.SHARPEN) This code sample gives us the opportunity to show how to convert the image data to a format suitable for fast texture update.

# data[].attributes.body
Write code to import an image then manipulate it using one of the ideas suggested here on this padlet

# data[].attributes.body
Invert the image that has been created. This would mean changing every pixel that is 0 0 0 to 255 255 255 etc.

# data[].attributes.body
Let the user choose red, green or blue. Based on the colour chosen saturate the image with a bias towards the chosen colour.

# data[].attributes.body
Allow a user to choose whether they want to make an image brighter or darker. Let them then choose the intensity of the filter.

# data[].attributes.body
Using a lossless compression algorithm reduce the file size of an image.

# data[].attributes.body
Rotate , flip or mirror an image that you have created or imported

# data[].attributes.body
Let the user choose from different filtering algorithms, which can then be applied to the image you have created.