Image search using google api - image

https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=apple+icon
Am using the above API to get the set of images for my search keyword.
The API return exact results for my search keyword. But what i want is, to limit the search images size and color.
Is it possible to send image size and image color as a parameter to the API call.
I have searched for the documentation but all in vain.
Thanks in advance.

From Google's API documentation:
Optional URl arguments:
imgsz
imgsz=icon
Restricts the search to images of the specified size, where size can be one of:
imgsz=icon restricts results to small images
imgsz=small|medium|large|xlarge restricts results to medium-sized images
imgsz=xxlarge restricts results to large images
imgsz=huge restricts resykts to extra-large images
And for colour (imgcolor) just above that...

Related

Google Cloud Storage for Image - resizing to original size does not work for some images

I use Google Cloud Storage for images. Images get uploaded to my Google App Engine based server. To serve the images I use the feature that allows image scaling. Just appending =sXXX to the image scales it to the desired XXX size for the largest side. Pecurliar that omitting =sXXX suffix scales to 512 pixels.
In order to NOT scale, one has to add =s0. This is what I do.
Sometimes, not always, I get this interesting problem. Serving URL uses =s0 suffix to ensure the original image gets download. Here is the example, which works
bread image, original size, =s0 suffix
It should work, this is documented in this Google App Engine article:
Images Python API Overview and also in this article Uploading, Resizing and Serving images with Google Cloud Platform
However for some images it does not work. Example:
This does not work:
http://lh3.googleusercontent.com/Kwj_Fe938vOxsVw9KFILW-MaxoNJlGinxfAHqj4_3bSxhHWPoSLXb5zXGn5k7V4BJgWRlgD1zvULpmjCnFhE1Q=s0
However removing the suffix =s0, shows image all right.
http://lh3.googleusercontent.com/Kwj_Fe938vOxsVw9KFILW-MaxoNJlGinxfAHqj4_3bSxhHWPoSLXb5zXGn5k7V4BJgWRlgD1zvULpmjCnFhE1Q
At least some other sXXX suffixes work
http://lh3.googleusercontent.com/Kwj_Fe938vOxsVw9KFILW-MaxoNJlGinxfAHqj4_3bSxhHWPoSLXb5zXGn5k7V4BJgWRlgD1zvULpmjCnFhE1Q=s250
So far I have not found a pattern. Looking at Google's bug repository for Cloud Storage does not reveal anyting useful.
Anyone has an idea where to look?

Laravel blade. Best way to show an image size according to the size of the screen

For each record, I have two images, small and large size. What is the best way to show an image size according to the size of the screen?
I know I can use css and mediaquery and show the small or large image using a div display none / block, but in this way, I understand that the user has downloaded both images even if they are not displayed, is that correct? Then, the page load increases. If so, what is the best option to do this?
For this problem the most efficient way is using the User-Agent to detect if a client is desktop, tablet or mobile.
I prefer to use Mobile_Detect or jenssegers/agent (based on Mobile_Detect).
Edit
Recently I installed the Google Pagespeed Module on my server. There is a filter, resize_rendered_image_dimensions, that returns images with sizes of the current client view (exactly what you are looking for).
Some other implementation would be lazyloading with Javascript and adding dimensions to the requested url depending on the viewport sizes.

High Resolution Image Using Google Chart API

I am using Google chart API to get a chart in image form via URL.
The URL I am passing in my 'img' tag is : https://chart.googleapis.com/chart?cht=pc&chco=FFFFFF,FFFFFF,FFFFFF,FFFFFF,74D3EF|EDEDED&chd=t:-1|-1|-1|-1|52,48&chs=122x122&chp=4.7
I am getting the image as I want, just wanted to know if i can get a high resolution image ?
Set the "chs" parameter to the dimensions you want:
https://chart.googleapis.com/chart?cht=pc&chco=FFFFFF,FFFFFF,FFFFFF,FFFFFF,74D3EF|EDEDED&chd=t:-1|-1|-1|-1|52,48&chs=500x500&chp=4.7
The ImageChart API supports images up to 30000 pixels total (eg, 500x600). If you need a higher resolution chart, you will have to switch to another chart API (like the Google Visualization API).

How does Google Image search with Image as parameter work?

I am interested in how google have done it's image search using an image. I am doing a project on image comparison and searching using images, and considering how impressive google image search using image seems to be, I am curious what they have done.
I also wonder how much they do actually image comparing and how much they use like keywords around images etc.

Is it possible set the JPEG quality using the get_serving_url() in Google App Engine?

When using get_serving_url(user.photoBlobKey) to return an image URL from the GAE Blobstore, the Google Images API returns a JPEG image with quality = 70 and size = 512px as default.
Is there any way to increase the default JPEG quality returned by get_serving_url()?
There's an undocumented URL parameter l, you can add it to the end of the image URL like so: =l100 (or =s640-l70 if you have another param before it) that should modify the output quality of the JPEG. Seems to be =l1 to =l100.
See also: List of all the App Engine images service get_serving_url() URI options
No there is not.
If you think it's a useful feature you can add an item to the issue tracker, from there the team will assess the demand for implementing it.
you can't control the output quality but by requesting
get_serving_url(user.photoBlobKey, size=0)
you will get the original size of the image up to 1600px height and width.
the returned url will be automatically postfixed with =s0 which you could add also before rendering the image in the template for example.

Resources