Command Line Software to Compress, Resize, Rotate, Images: 2JPEG

Editor Ratings:
User Ratings:
[Total: 0   Average: 0/5]

2JPEG is a free command line utility for converting your PDF documents and image files to JPG format in batch mode. It supports almost any existing image file format and PDF document as input, and converts them in the JPEG format. It can be used in a variety of situations, such as converting or compressing or resizing your existing images or creating their thumbnails etc..

2JPEG is an advanced image processing command line tool. This software is free for personal use, but it has one limitation that it adds “Created by 2JPEG |” text in the bottom right corner of the image, otherwise it is a perfect tool for anyone’s toolbox. The best thing is that it supports batch mode, it can dig into sub-folders, filtering out given file extension and apply specified operation. Suppose you want to convert bunch of png files into jpeg format, then you need to run “2jpeg.exe -src “D:\in\*.*” -dst “D:\Out”” command to achieve your goal. It will display log of operations performed on the command prompt, as shown in the image below.

2JPEG - demo

You can do silent install of this utility by running following command with administrative privileges. This requires that you have downloaded the setup of this program and it is present in your download directory.

"C:\Users\%username%\2jpeg-free-setup.exe" /silent

This utility has four switches to specify the input directory (src), output directory (dst), operations to be applied (oper) and options (options). Full syntax of this utility is as following:

2JPEG.exe –src “Input directory name” –dst “output directory name” –oper/jpeg “operation name” “parameter1”:”value” [“parameterN”:”value”] –options “option name1”:”value” [“option name2”:”value”]

I have listed possible uses of this utility with syntax as following. You may use it as an example to learn more about how to use this utility and use this knowledge to learn advanced features of this utility from its official documentation.

How to Use 2JPEG in Different Scenarios:

1. Convert images in the unknown format to JPEG format.

Specify input and output directories to apply conversion.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -jpeg mode:baseline bpp:24 quality:92 subsampling:421 opthuff:no interleaved:yes keepexif:yes keepiptc:yes thumbnail:yes

2. Compress your image files.

Specify quality parameter to achieve desired image size.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -jpeg mode:baseline bpp:24 quality:64 subsampling:111 opthuff:no interleaved:yes keepexif:no keepiptc:no thumbnail:no

3. Resize images to new height and width.

Specify width and height for Resize parameter to resize your images.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Resize size:"600 550" units:pixels keepprop:yes method:bilenear nozoom:no

4. Convert scanned or any PDF files back to JPEG

Specify template of output image files. Remember “in” folder of your D drive should have some PDF files.

2jpeg.exe -src "D:\in\" -dst "D:\out" -options template:"{Title}-page{Page}.jpg"

This may come in handy if you have a large scanned pdf  file and it takes ages to load it on your device.

5. Convert print restricted PDF files to JPEG images

Specify page rage in “pages” parameter.

2jpeg.exe -src "D:\secured.pdf" -dst "D:\out" -options pages:"2,4,43-44,50" template:"{Title}-page{Page}.jpg"

If you come across a print restricted PDF file then you can this method to convert it into image and then that converted image can be easily printed.

6. Add your customized text watermark or trademark in the image

Specify some text in “text” parameter. Also, specify font, font size, styles and horizontal and vertical alignment as a relevant parametric value.

2jpeg.exe -src "D:\in\input.jpg" -dst "D:\out" -oper TextWatermark text:"(C) ILoveFreeSoftware" font:"Arial" fontsize:10 bold:yes italic:yes underline:no halign:right valign:bottom offx:10 offy:15

7. Crop images in bulk

This one is simple, you only need to specify various margins and this utility will take care of rest.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Crop method:margins left:80 top:80 right:80 bottom:80

There are two more crop methods which crop images depending upon given tolerance and color code. Please refer to official documentation to know more about this feature.

8. Mirror image vertically or horizontally or both

Simply, specify the value of flip parameter from this list: horizontaly, verticaly or both.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Mirror flip:horizontaly

9. Rasterize vector file

Specify the resolution of final image along with the units of rasterization parameter.

2jpeg.exe -src "D:\in\*.pdf" -dst "D:\out" -oper Rasterize res:200 units:DPI

10. Rotate image  to any angle

Specify the value of angle parameter and also the RGB value of the background color parameter.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Rotate angle:90 color:"r:255,g:255,b:255"

11. Add picture watermark to your image.

Specify the location of watermark picture and its alignment in final outcome images.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper watermark image:"D:\watermark.png" halign:center valign:center

12. Make your image files black and white.

Just specify the input and output folder and 2JPEG would take care of the rest for you.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Grayscale

13. Apply unsharpen mask to your image files.

Specify the sharpen radius and its amount to be applied on input images.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Sharpen radius:15 amount:80

14. Apply autolevel to remap the luminance of each pixel of your image files.

Just specify the input and output folder and 2JPEG would take care of the rest for you.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Autolevels

15. Apply blur effect to your image files.

You only need to specify blur radius in pixels and 2JPEG would take care of the rest for you.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Blur radius:12

16. Do contrast correction for your image files. –options silent:yes

Value of contrast parameter ranges from -100% to 100%. Choose any value from the mentioned range.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Contrast percent:-24

17. Do gamma correction for your image files.

Value of gamma parameter ranges from -100% to 100%. Choose any value from the mentioned range.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Gamma percent:-12 –options delsrc:yes

You can use “delsrc” option to delete source images.

18. Change brightness of your image files.

Value of brightness parameter ranges from -100% to 100%. Choose any value from the mentioned range.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Brightness percent:-12 –options log:yes

You can use “log” option to create log of performed operations.

19. Apply sepia effect to your image files.

Just specify the input and output folder and 2JPEG would take care of the rest for you.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Sepia –options overwrite:yes

If “overwrite” option is enabled then any file with conflicting name in the output directory would be overwritten.

20. Smooth out noise of your image files.

Just specify the input and output folder.

2jpeg.exe -src "D:\in\*.*" -dst "D:\out" -oper Smoothingnoise –options scanfs:no

If you do not want to dig inside sub-folders of the input folder then you should use option “scanfs” with “value” no option.


2JPEG is an awesome command line utility for novice and experts alike. Although it has a steep learning curve, but you would be always thankful to yourself for learning commands of this utility. The strength and usefulness of it is not compromised by missing GUI; in contrast it has made it more powerful. At least, it is a must have utility for my toolbox.

Get 2JPEG here

Editor Ratings:
User Ratings:
[Total: 0   Average: 0/5]
Works With: Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8.x, Windows server 2003, 2008, 2012
Free/Paid: Free

Get 100 GB FREE

Provide details to get this offer