PEF2JPEG Ver.1.3.6 : Extract L* jpeg from raw data of Pentax *istD / K series digital SLRs

*istD web-ring home

[Special Notice]
Ver.1.3.6 : Ready for K-5, K-x, K-r. Runs on Windows 7.
Ver.1.3.5 : Ready for K-7 (tentative).
Ver.1.3.4 : Ready for K20D, K200D, K-m (tentative).
Reports/comments are welcome.

Serious problem for Vers.1.2.1 - 1.2.4
The above versions cannot start at your first launching after installation. When PEF2JPEG.ini file exists, the programs run properly.

[Disclaimer]
This program ("PEF2JPEG") is a free software, and may be freely redistributed provided that no charge above the cost of distribution is levied. The author keeps the copyright. The author is not responsible for any damage or losses of any kind caused by the use or misuse of the program. The reports or comments on this program are welcome.

[Download]
A non-compressed executable file is availabe here.

[For what?]
This program extracts L*-grade (so-called "economy" grade) jpeg data from Pentax *istD / DS / DL / DS2 / DL2 / K100D / K10D / K20D / K200D / K-m / K-7 / K-5 raw data. Although I have not confirmed, K110D, K100D-super, K-x, and K-r data may be handled. The program does NOT develop the raw data, but only extracts rapidly the "embedded data" (that the internal engine of the camera developed).

This program reconstruct some of Exif informations including the maker-dependent notes. The extracted file supplies major informations about shooting conditions to many useful tools, such as Pentax Browser (bundled with *istD/DS), Exif Reader by Ryuji Yoshimoto, and *istD View by Shirozauki.

*istD View is a cool image viewer supporting *istD/DS raw data and it can display several data by analyzing the internal informations, including lens information with the assistance of Lens-ID data assembled by Mint Star. The author aimed compatibility with the viewer.

[How to]
(Before installation)
This program is written with Visual Basic 6.0 SP6, and requires the corresponding run-time libraries. Before using the program, you have to install the libraries. They are available from here, for exampleD

(Installation)
The author prepared no installer. Place the downloaded exe file (pef2jpeg.exe) in an appropriate folder. Making a shortcut on your desktop may make operation easy. The program automatically creates pef2jpeg.ini file for keeping the last state in the identical folder. For uninstallation, remove exe and ini files. This program does not modify any registries.

(Operation)
Select file(s) and click "Execute" button. You will find the corresponding JPEG file(s). You can select more than one file. Batch processing for all files is also available by checking "Extract from All PEF files" check-boxD

(Destination)
Destination foloder of the extracted files is selectable from the following three options:
(1) the identical folder with the one where the PEF file exists ("Current folder")
(2) "JPEG" sub-folder under the folder where the PEF file exists ("JPEG sub-folder", automatically created)
(3) the folder you selected arbitrarily ("User defined folder", click the "..." button and specify a folder).
For the case of (2), a file with a name "JPEG" terminates the processing. Remove or rename the file for normal processing.

(Drag & Drop)
This program supports drag & drop action. By dragging & dropping a PEF file or a folder including PEF file(s) from Explorer to the program shortcut icon, the program starts with opening the corresponding folder. The left frame can also accept dragging and dropping a file or folder.

(Shortcut buttons)
"My Documents" and "Desktop" buttons directly open the respective folder.

(File name of extracted data)
The file name of the extracted data is "base name of the PEF file" + "_L1" with an extention ".jpg". For example, "IMGP0001_L1.jpg" file is created from "IMGP0001.PEF" file. The identifier was changed from L1 to _L1 at Ver.1.3.2 because of compatibility to the Windows Explorer file name sorting system. When a file with the identical name exists, the program overwrites the file without any warning.

The time stamp of the created file is set to "Original Date" of the photography.The internal proceesing in the OS may cause error with about one second.

The file listbox displays files with ".PEF" extention, and the program only processes "PEF" files. The program independently checks the inconsitency. The folder may contain any types of files.

[Author's notes]
Most of digital SLR camera users love "raw" shooting! ...Ummm... The developing is somewhat complicated... JPEG outputs are of convenience and with sufficient quality for the most part of general use... for example, creating web contents. Some cameras feature simultaneous record of raw and JPEG data, although Pentax istD/Ds does not.
However, *istD/DS raw files include JPEG thumbnail images of three different sizes: 240x160, 640x480, and 3008x2008 (3008x2000 for DS and later models of *istD series and K100D, 3872x2592 for K10D). Simple extraction of the appropriate JPEG may be a solution of the above problem :-)

The earlier version of this program only features the simplest extraction. The format of the extracted files is the simple JPEG and includes no shooting data nor camera conditions.
NOW, the current version embeds the informations in the JPEG data according to Exif format. Though the processing speed is not very fast, it is just a moment comparing development :-)

NOTE that this program embeds PORTIONS of Exif informations (and maker notes), not completely.

[Others]
The author develops the program using Visual Basic 6.0 SP5 on Windows XP SP3.
The author also confirms the behavior on Windows 7.

[Comments are WELCOME]
E-mail me.

[Thanks]
The earliest version of the program works based on the informations available here.
The author analyzed *istDS raw files supplied in 2ch BBS.
The author referred description of Exif format by Tsuruzoh Tachibanaya.

For developing programs, the author refers many tips on VB available on the net, and uses helpful free softwares. For writing this program, a binary editor Stirling and an Exif analyzing tool Exif Reader are especially acknowledged.

Martynas_ds@Vilnius/Lithuania supplied a K100D PEF file.
iwana@mixi supplied a K-m PEF file.
U. Witte@Hamburg/Germany supplied a K-5 PEF file.

[Changes] (Personal memo :-))
Ver.1.3.6 K-5, K-x (tentative), K-r (tentative) ready.
Ver.1.3.5 K-7 ready.
Ver.1.3.4 K-m ready.
Ver.1.3.3 Some bugs are fixed. K20/200D ready (tentative).
Ver.1.3.2 Changed identifier for extracted JPEG from L1 to _L1 (extracted file name is ***_L1.jpg).
Ver.1.3.0 K100D PEF ready (public). Corrected a bug on makernotes extraction. Alexandar Kurjakov reported and the author confirmed K10D compatibility.
Ver.1.2.7 K100D PEF ready (tentative)D
Ver.1.2.6 Confirmed DS2/DL2 data handling.
Ver.1.2.5 Fixed start-up problem (can't start without .ini file) (reported by Jens Rösener).
Ver.1.2.4 Reconstruction of Orientation tag for DS and later models (requested by Nathanaël Lécaudé)
Ver.1.2.3 Supports DL PEF. DS2 PEF ready, though not confirmed,.
Ver.1.2.2 Open linked target for dropping a shortcut. Corrected progress bar action when "All PEF files" check box is not checked.
Ver.1.2.1 Corrected image data extraction. D&D.
Ver.1.2.0 Added embedded tags (compatible with Pentax Browser 1.1).
Ver.1.1.0 Corrected Sub IFD entry number. Shortcut buttons for special folders.
Ver.1.0.0 Reconstruction of Exif header.
Ver.0.4.1 Made time stamp original date/time.
Ver.0.4.0 Selectable destination folder (requested by Katsuaki Akaoka).
Ver.0.3.0 Proper :-) analysis of Exif tags.
Ver.0.2.0 Tentative compatibility with *istDS PEF.
Ver.0.1.0 First release.