We can check your plugins and stuff
Showing posts with label Linux Photo management. Show all posts
Showing posts with label Linux Photo management. Show all posts

Tuesday, December 6, 2011

RAW vs JPEG file showdown

Well some times I get mails and questions like ....  keep hearing about something called RAW what is a Raw file ??? Should I use the RAW mode of my camera ??? RAW mode is slow why should I use it.. Jpeg or RAW which is the best and why ???

OK so here we go ...

What is a JPEG file:

Simple answer: A graphic file type that is almost universal and can be opened anywhere. Is small in size. Offers good to decent image quality.

Technical answer: The name "JPEG" stands for Joint Photographic Experts Group, the name of the committee that created the JPEG standard and also other standards. The JPEG standard specifies the codec. A codec is a device or computer program capable of encoding or decoding a digital data stream or signal. The word codec is a portmanteau of "compressor-decompressor" or, more commonly, "coder-decoder".

Which defines how an image is compressed into a stream of bytes and decompressed back into an image, but not the file format used to contain that stream. The compression method is usually lossy, meaning that some original image information is lost and cannot be restored, affecting image quality. There is an optional lossless mode defined in the JPEG standard; however, that mode is not widely supported in software products.

What does a JPEG file contain: 
  •     Color space definition
  •     Component sub-sampling registration
  •     Pixel aspect ratio definition.
What is RAW file:

Simple answer: A graphic file type that is different for each company or even camera model no. (e.g Canon .CRW and .CR2 files). RAW files are much bigger in size. Offers the best image quality. RAW files require special software to open and edit. A camera raw image file contains minimally processed data from the image sensor. Raw files are so named because they are not yet processed and therefore are not ready to be printed or edited. Normally, the image is processed by a raw converter software.

Technical answer: Raw image formats are intended to capture as closely as possible (i.e. at the best of the specific sensor's performance) the radiometric characteristics of the scene, that is, physical information about the light intensity and color of the scene. Most raw image file formats store information sensed according to the geometry of the sensor's individual photo-receptive elements sometimes called pixels rather than points in the expected final image: sensors with hexagonal element displacement, for example, record information for each of their hexagonally-displaced cells, which a decoding software will eventually transform into the rectangular geometry during "digital developing".

Raw image files are sometimes called digital negatives, as they fulfill the same role as negatives in film photography: that is, the negative is not directly usable as an image, but has all of the information needed to create an image. Likewise, the process of converting a raw image file into a viewable format is sometimes called developing a raw image, by analogy with the film development process used to convert photographic film into viewable prints. The selection of the final choice of image rendering is part of the process of white balancing and color grading. Like a photographic negative, a raw digital image have a wider dynamic range or color gamut than the eventual final image format, and it preserves most of the information of the captured image. The purpose of raw image formats is to save, with minimum loss of information, data obtained from the sensor, and the conditions surrounding the capturing of the image.

What does a RAW file contain:

  • A short file header which typically contains an indicator of the byte-ordering of the file, a file identifier and an offset into the main file data.
  • Camera sensor metadata which is required to interpret the sensor image data. This includes the size of the sensor, the attributes of the CFA and its color profile.
  • Image metadata which is required for inclusion in any CMS environment or database. These include the exposure settings, camera/scanner/lens model, date (and, optionally,place) of shoot/scan, authoring information and other. Some raw files contain a standardized metadata section with data in Exif format.
  • An image thumbnail. Optionally a reduced-size image in JPEG format, which can be used for a quick and less computing-intensive preview.
  • The sensor image data
Ok all this info is awesome and all but, too much info and computer tech doodle. Can you give me some simple easy to use information ;) ...Sure

JPEG versus RAW:
JPEGs are:
Faster to shoot
Faster to Save
Smaller in file size, consequently you can save many more panos/images on a drive.
Can be opened/edited in just about any graphics program
Cross-platform
Little or no learning curve
Anyone or almost any camera can shoot JPGs
8-bit files (only 256 color per channel)
Limited ability to color correct
Generally, you need to bracket in ONE f-stop increments.
Very limited in overall detail, but especially in highlight and shadow details
(in other words dark areas go black quickly and highlights go completely white quickly)
Better for shooting "journalistic" or fast moving/changing scenes, especially with people in them.

RAW files are:

Slower to shoot
Slower to save (More bits = bigger file size = more hard drive space needed = less images can be saved to a hard drive)
Larger in file size (14-bit RAWs are about 25% larger than 12-bit RAWs)
12-bit files have 4096 colors per channel and 14-bit files have 16,384!
Are "proprietary" per camera manufacturer and even within a single manufacturer
(i.e.: Canon) they have multiple RAW formats (i.e.: .CR2 and .CRW)
Much more exposure latitude, consequently fewer photos to cover a large exposure range.
(i.e. 3 RAW files can cover a range that 5 or 6 jpegs would be needed to cover)
This also means less bracketing!
Ability to change color temperature after its been shot.
Have to be "processed" in a digital darkroom (i.e.: Adobe Lightroom) and then saved as secondary file such as Tiff, JPG, EXR, etc.
Are Non-destructive! At this point, RAW files cannot be saved. Therefore you can always go back to the original and make additional corrections.
Are naturally a bit "soft" looking. RAW files are INTENDED to be sharpened, so some photographers have a hard time switching for that reason alone.

**Special note -- Cameras with a small sensor size like many Pro zoomers and Four-micro systems. Using ISO speeds of over 800 or more generally results in bad quality or lot of digital noise. Using a RAW file will always give you better results after De-nosing/noise removal than using a jpeg.

In terms of colors, what is the difference between 8-bit, 12-bit, 14-bit, and 16-bit files?
    • 8-bit files: 256 colors (shades of gray) per RGB channel
    • 12-bit files: 4,096 colors (shades of gray) per RGB channel
    • 14-bit files: 16,384 (shades of gray) per RGB channel
    • 16-bit files: 65,536 colors (shades of gray) per RGB channel

Cool so still why use RAW ??
In terms of practical application, having more bits per channel basically means more subtle/smoother color variations, more highlight, and more shadow details are
available.This simply means that you will have more rich and bright, vibrant colors = better looking photographs. Personally, I always try and shoot RAW. Once you go RAW, you never want to go back to the “old” way. (Assuming you know how to properly process them)

Nice how do I start with RAW files and what software is needed???

Set your camera to RAW mode. Start shooting. For basic simple level editing of RAW files use IrfanView free get it at http://www.irfanview.com/

For proper full "processed" RAW file in a digital darkroom use Adobe Lightroom or
Raw Therapee free get it at http://rawtherapee.com/

Then saved as secondary file such as Tiff, JPG, EXR, PNG.
I recommend using PNG over JPG much better quality and decent file size.

Why not use RAW files ??
You have a old and slow computer.
Full and proper RAW processing requires a fast computer with lots of RAM.
RAW files take a lot of space, so if you are running out of disk space it is better to use JPEG.
You mainly shoot to upload the photos online, best possible quality is not an absolute requirement.
You do not want to learn new software and do any type of digital processing.
Developing/Processing RAW files is a time consuming activity. Which may lead to excessive consumption of Coffee, jolt cola, red bull and other such energy drinks ;)
You are pressed for time, you just need basic edit, crop, save. Use jpeg
You are just plain lazy ;)

Disclaimer: Parts of this post were sourced from the Internet and placed here for easy and quick reference.

Monday, February 14, 2011

How to pull the latest stable code of DIGIKAM and SHOWFOTO

Digikam and ShowFoto are two great programs that anyone who is into photography whether as an amateur or professional should have. It is one of the best open source software that I use on almost on a daily bases. If photography is your passion and you have a lots of pictures clicked via cellphones, point and shoot cameras, and high end pro kit.
There will come a time when you will need to have a Digital Workflow/Photo management in place. It does not matter if you are just looking for a quick and dirty solution to do some resizing, cropping, color correction or you on the lookout for serious professional features like converting RAW files, RAW to DNG conversion, noise reduction in batch mode. Digikam and ShowFoto fit the bill perfectly. The best part is both of the software are fully Open source and available on multiple platforms like Windows, Mac OS and Linux.

If you have been reading my blog you know I love to tinker with code and compile stuff... No no do not get worried as I said even if you are a amateur shutterbug  you can use Digikam and ShowFoto. The following steps are for the absolute new user on Fedora Linux with the KDE Desktop Environment. Digikam and ShowFoto are part of the KDE graphics core. They are simple to install via yum.


[root@localhost ~]# yum install digikam

This will install both digikam and showfoto and can be  found under the Graphic Menu. Give it a spin, you will love it.

Ok now for readers who are already using digikam and showfoto esp on Fedora Linux, you all know the great developers are constantly working hard to fix any bugs and bring out new features for the users to try out. New version are being rolled out every now and then. As Fedora Linux is not a rolling distro, the default fedora repos will have the older version of the software. Now some would question why do we need the latest and greatest version anyway ???
The answer is some what simple, bug fixes, new features that you may need, speed. The most important of all support for new cameras and RAW file formats that you have or plan to buy soon.

Now we will see how we can have latest stable build in no time without waiting for the repos to be updated ;) In order to compile digikam and showfoto we need to some software per installed. Why compile -- two words speed and stability. Here we go ... Please note photo processing and editing is a very complex process and requires a lot of different type of software and libraries and third party software. It is best of you have the latest stable build of KDE and dev tools install as this will reduce the time taken to download the files required.

[root@localhost ~]# yum-builddep digikam -y

This command will check all the missing software, programs and libaries that are need to compile digikam and showfoto. This can take some time depending how fast internet access you have and what all packages are installed/missing.


No source RPM found for digikam-1.7.0-1.fc14.1.kde46.x86_64
No source RPM found for digikam-1.6.0-1.fc14.x86_64
Getting requirements for digikam-1.7.0-1.fc14.src
 --> Already installed : libgphoto2-devel-2.4.10-2.fc14.x86_64
 --> Already installed : 7:kdegraphics-devel-4.6.0-0.1.fc14.x86_64
 --> Already installed : mysql-devel-5.1.55-1.fc14.x86_64
 --> Already installed : kdepimlibs-devel-4.6.0-0.1.fc14.x86_64
 --> Already installed : desktop-file-utils-0.16-1.fc14.x86_64
 --> Already installed : gettext-0.18.1.1-4.fc14.x86_64
 --> Already installed : lensfun-devel-0.2.5-3.fc14.1.x86_64
 --> Already installed : mysql-server-5.1.55-1.fc14.x86_64
 --> Already installed : kdeedu-devel-4.6.0-0.1.fc14.x86_64
 --> Already installed : 7:kdegraphics-devel-4.6.0-0.1.fc14.x86_64
 --> Already installed : lcms-devel-1.19-2.fc14.x86_64
 --> Already installed : 2:libpng-devel-1.2.44-1.fc14.x86_64
 --> Already installed : 7:kdegraphics-devel-4.6.0-0.1.fc14.x86_64
 --> Already installed : liblqr-1-devel-0.4.1-1.fc12.x86_64
 --> Already installed : sqlite-devel-3.6.23.1-1.fc14.x86_64
 --> Already installed : libtiff-devel-3.9.4-1.fc14.x86_64
 --> Already installed : glib2-devel-2.26.0-2.fc14.x86_64
 --> Already installed : 1:doxygen-1.7.3-1.fc14.x86_64
 --> Already installed : 6:kdelibs-devel-4.6.0-0.2.fc14.x86_64
 --> Already installed : jasper-devel-1.900.1-16.fc14.x86_64
 --> Already installed : soprano-devel-2.6.0-0.1.fc14.x86_64
No uninstalled build requires

On my system as I have already all the required files installed. Once we have all the necessary software installed we will download the latest code of digikam and showfoto.


#wget -c http://anongit.kde.org/digikam/digikam-latest.tar.gz
Once the source tree is downloaded extract the tarball and execute the shell script inside. This will build the source tree. Change the directory to digikam 
[root@localhost Downloads]# cd digikam/
[root@localhost digikam]# git pull
remote: Counting objects: 168, done.
remote: Compressing objects: 100% (97/97), done.
remote: Total 97 (delta 90), reused 0 (delta 0)
Unpacking objects: 100% (97/97), done.
From http://anongit.kde.org/digikam
   a699bc9..28a90d6  development/2.0 -> origin/development/2.0
Already up-to-date.

By doing a git pull the code will be sync to the latest stable release. On your system it should pull and update the source tree. My system has been updated against the latest stable tree.

Ok now we come to the final build steps... [yep this is a long post ;)]
[root@localhost digikam]# mkdir build && cd build
[root@localhost build]# export CFLAGS='-O3 -pipe -march=native' && export  CXXFLAGS='-O3 -pipe -march=native'
We did say we were after the fastest build possible ;)
[root@localhost build]#cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE='release'

After cmake does a lot of checking and writes out the required files..  you should see
-- Adjusting compilation flags for GCC version ( 4.5.1 )
-- Configuring done
-- Generating done
-- Build files have been written to: /root/Downloads/digikam/build

Now just to be sure that we are making the fastest possible build for the given system, open CMakeCache.txt in a editor and make sure it has these lines.
//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING='-O3 -pipe -march=native '

[root@localhost build]#make -j6  (start the compilation, can take some time depending on the system) 
Linking CXX executable digikam                                                                                                                                                   
[100%] Built target digikam ( wow we are in business :D )
Play around with the build inside the digikam and showfoto folders and check for any stability issues. (I never had any)
[root@localhost build]#make install (to install the build)

woot woot!!!!!!!! That's it enjoy :D :D