Are you feeling tired to convert RAW images to JPEG? I am saying a bunch …

I am a Fuji lover, snapping down almost every scene happens in front of me. I use to store my photos on a cloud but the heavyweight of the Raw images teaches me that 1TB is not enough in the long-run. There are basically two choices for me: subscribing more storage on the cloud + buying other hardware devices for storing OR converting those 50Mb giants to jpeg that will release 9 times more spaces for my cloud.

Lightroom is my favourite photo editor and Adobe offers cloud usage based on your subscribing plan, mine is 20Gb. I used to spend my afternoon just doing importing, deleting, exporting of the RAW images, believe me, it is stupid. To keep the cloud storage under the 20Gb limit, I waited for Lr to delete, waited for Lr to import and export. The process takes a lot of time unless you are having a high computing-power CPU.

Thus, I searched for the way to make the converting process more efficient and I ended up with Python — automated and fast converting. In this sharing, I will directly go to how to use the code, and I hope you can save your $$ and time.

Here is the link to the source code: https://github.com/TheKinng96/PythonImageEditor/tree/master

Yes, it is just a 22 lines code

To run the code, you need to make sure that:

# Python is installed on your machine

#Pillow, rawpy, and imageio (Python libraries) are installed through pip install command

After setting up the environment and copied the code, remember to save the code you typed to your_name.py before running the code.

Now let's go and run the code:

Directory checking
  1. Open up the file explorer and go to the folder you saved the Python code file. *Remember to save the code in .py format*
  2. Copy the directory **just simply point the column and right-click copy

3. Go to CMD and type “cd the_directory” *simply just paste and press enter, then the last line should be shown up and the directory should be the folder you saved your code. **cd stands for change directory

4. Type the following codes: python your_file_name.py folder_your_photo_located folder_to_save_the_output

  • *venv is the virtual environment of my project, you can run the code outside of the venv.
  • *venv is to separate the code in a clean and controlled environment, avoiding the changes happened during common upgrades of our application to affect the running and testing of the code.
  • it will be another topic to discuss on what and why, but the topic will be skipped here.

Meaning of the code lines:

#python RawImageConvertor.py:

  • Tell CMD to run a Python code called “RawImageConvertor.py” *I know … it should be “converter”…

#folder_your_photo_located:

  • if the folder is located in the same folder where you saved the python code, then just type “the folder name”
  • otherwise, to locate the folder outside the python folder → “C:\Users\user\Desktop\”, paste the folder directory like the format in the example

#folder_to_save_the_output:

  • if the folder has not yet created, the code will create for you
  • if you just write for example “output”, then the converted images will be stored in the ‘output’ folder in the Python folder
  • you can order the code to store your converted images to somewhere like “C:\Users\user\Desktop\output” or an existing folder, just replace the directory

CONCLUSION

I coded this little application to save the cloud space and my time to manually click select all and export in Lightroom. It is helpful when you have thousands of photo to convert. This code runs fast and the best thing is it is an automated conversion until it loops out all images in the folder.

If you read til here, I appreciate you spending time reading this article.

More information on rawpy library, check this out https://pypi.org/project/rawpy/. There are more functions to do in the process like resize, changing white balance and so-on.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store