Where can I find a database with a lot of high-resolution CIE L*a*b* images? - image

I'm looking for a database with a lot of high-resolution CIE Lab* images. Do you know where can I find it? I found RGB images only.

There are not many formats that are able to store images in CIE Lab colourspace, in fact the only one I know of is TIF and I believe CIE Lab colourspace is actually only an extension that not all software is able to handle.
I can only suggest you find a suitable database in another format and convert it yourself. You can do that painlessly with ImageMagick which is included in most Linux distros and is available for macOS and Windows. So, to convert a single hi-res PNG file to CIE Lab colourspace and save as TIF, you could run this in Terminal:
magick input.png -colorspace Lab result.tif
If you had hundreds of PNGs, you could do them all in one go with:
magick mogrify -colorspace Lab -format TIF *png
If you are using ImageMagick v6 or older, use:
convert input.png -colorspace Lab result.tif # for single image
mogrify -colorspace Lab -format TIF *png # for multiple images

Related

Batch convert white background to transparent

Seeking to set a folder of PNG line drawings to background transparent and getting lost in examples and options recommended for other cases. Essentially when I find a line of command that seems to fit I don't know how to apply it to an entire folder. Also getting lost in options like fuzz and anti-alias which I'm not even sure would benefit my images, below. I'm on a Mac running v7 of Magick and really appreciate your kind help.
Simplest Sample
Most Complex Sample
This should do what you want in Imagemagick 7. You should use magick mogrify to process a whole folder of images. To convert white to transparent in an image you can use -fuzz XX% -transparent white, where XX is a percent tolerance for nearby colors. For JPG, typically about 15% seems to work due to jpg compression change of flat colors. So I put your images into a folder called drawings and create a new empty folder called drawings2 to hold the output image, which need to be PNG (or TIFF) so use transparency.
cd
cd desktop/drawings
magick mogrify -path ../drawings2 -format png -fuzz 15% -transparent white *.jpg
Results:
See https://imagemagick.org/Usage/basics/#mogrify

How to make an almost black image very high contrast

I am seeing the following image in a paper:
However, when I download the associated dataset with the paper, the images are like this:
How can I make the almost black images in the dataset looking like the one in the paper?
link to dataset: http://www.cs.bu.edu/~betke/research/HRMF2/
link to paper: http://people.bu.edu/breslav/084.pdf
The contents of this dataset is saved as 16 png data. But ordinary display has only 8bit dynamic range. So we cannot display them without windowing. Please try to use ImageJ, it can map 16bit data into visible 8bit data.
https://imagej.nih.gov/ij/index.html
It can show as following.
As the other answers rightly say, the images are in 16-bit PNG format. You can convert one to a conventionally scaled, viewable JPEG with ImageMagick which is installed on most Linux distros and is available for macOS and Windows.
So, in Terminal:
magick 183.png -auto-level 183.jpg
If you would like to convert all 800 images to JPEGs in one go, you can use ImageMagick's mogrify like this:
magick mogrify -format JPEG -auto-level *png
Note that if your ImageMagick is the older v6 (as opposed to the v7 commands I used) the two commands become:
convert 183.png -auto-level 183.jpg
mogrify -format JPEG -auto-level *png
The images in this dataset have high dynamic range of 16-bits per pixel. Image viewer you are using is mapping 16-bit pixels to 8-bit ones, in order to display them (most displays can only effectively handle 8 or 10 bits of brightness). Most image viewers will just truncate the least significant 8 bits, which in your case produces nearly black image. To get better results, use ImageJ (Fiji distribution is the easiest way to get started), which displays this:

Compressing an image to make it less than 4KB

I have an image of a person and I want to compress it to make it less than 4KB. I need to compress it and still have the face of the person recognizable even if the image will shrink.
Here is Theresa May at 142kB:
and resized to 72x72 and converted to greyscale and reduced to 2kB with ImageMagick at the command line:
convert original.jpg -resize 72x72 -colorspace gray -define jpeg:extent=2kb result.jpg
I can still recognise her.
Here is some other guy reduced to 1kB and I can still recognise him too:
ImageMagick is installed on most Linux distros and is available for macOS and Windows. Bindings are available for Python, PHP, Ruby, Javascript, Perl etc.
If you had further knowledge about your images, or your recognition algorithm, you may be able to do better. For example, if you knew that the centre of the image was more important than the edges, you could slightly blur, or reduce contrast in relatively unimportant areas and use the available space for more details in the important areas.
Mark Setchell has the right idea. But I might suggest one potential minor improvement. Remove any meta data including profiles, EXIF data etc. You can do that by either adding -strip
convert input.jpg -strip -resize 72x72 -colorspace gray -define jpeg:extent=2kb result.jpg
or by using -thumbnail rather than -resize. The former automatically does the strip.
convert input.jpg -thumbnail 72x72 -colorspace gray -define jpeg:extent=2kb result.jpg

Converting Tiff images to LAB colorspace with Imagemagick

I am completely new to Imagemagick and I need to convert different types of images to the LAB colorspace.
I Am currently using this command:
magick convert "input4.tif" -flatten +profile tiff:37724 -colorspace Lab -auto-orient -intent Absolute -compress LZW "output4.tif"
The problem is that this command does not seems to work for ECI-RGB images and CMYK images.
If I convert a CMYK image to LAB, the image looks completely oversaturated in magenta and cyan.
If I convert an ECI-RGB image to LAB, it is a bit darker than the original.
Help would be greatly appreciated,
Thanks

ImageMagick: Can I control which instance is used from a multi-resolution .ico file?

We have an in-house tool that does some operations on windows icon files. Turns out that it only really supports the type of .ico files that are generated by ImageMagick. Should be no big deal because we currently use ImageMagick anyway to generate sizes not supplied in the original image. My plan was to always use ImageMagick to generate images, even when the original .ico file contained an image with the correct resolution, to ensure the image was of the correct format.
So far, so good. However in practice this does not seem to work the way I expect it to. Specifically I'm after a 256x256 icon. The original file contains (I believe) a 256x256 version as it looks high res when viewed from the browser. However, the output file from ImageMagick is obviously a low-resolution one scaled up.
The command line I'm using is:
convert.exe orig.ico -background #FFFFFFFFFFFF0101 -compose Copy \
-gravity Center -scale 256x256! -depth 8 temp2.ico
Question: is there some better set of commands to use, which might start from the 256x256 icon?
Your orig.ico file probably contains multiple dimensions. They will also be stored in the output file. This means a dimension of 16x16 will be upscaled to 256x256 and that produces an ugly image. The 256x256 resolution is most likely the first dimension. You can see all the dimensions with the following command:
identify.exe orig.ico
With the command below you can get a specific dimension/image by specifying the index (starts at zero):
convert.exe orig.ico[0] -background #FFFFFFFFFFFF0101 -compose Copy ^
-gravity Center -scale 256x256! -depth 8 temp2.ico
If the 256x256 dimension is the last image you should set the index to -1:
convert.exe orig.ico[-1] -background #FFFFFFFFFFFF0101 -compose Copy ^
-gravity Center -scale 256x256! -depth 8 temp2.ico

Resources