Plugin request: Lossless transformation of JPEG files

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Sombra
Power Member
Power Member
Posts: 814
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Plugin request: Lossless transformation of JPEG files

Post by *Sombra »

Hello,
An idea for authors of plugins, Could be possible make a plugin (WCX) for Lossless transformation of JPEG files. With operations similar to the window of irfanview. :D
I was looking for a similar plugin, but I don't fin any. Exist any plugin?
I can read English, but... I write like Tarzan. (sorry)
User avatar
byblo
Senior Member
Senior Member
Posts: 270
Joined: 2005-02-20, 21:13 UTC
Contact:

Post by *byblo »

If irfanview support lossless jpeg on his command lines, you can try this good plugin, which work with program which accept param lines : Total Converter v1.0.1 : http://www.totalcmd.net/plugring/ctconv.html (ctrl+down to enter in a picture file like an archive, an select the desired file output)

As example, you can enter into a bmp to select a jpg, or into a wav file to select a mp3 ;) The quality and other depending on each command line you add (once, when configured).
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

For image manipulation you can use ImageMagick, it's command line driven:
http://www.imagemagick.org/

IrfanView doesn't have a lossless JPEG transform by command line, maybe ImageMagick has, check it out yourself.

Icfu
This account is for sale
User avatar
Sombra
Power Member
Power Member
Posts: 814
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Post by *Sombra »

byblo wrote:
you can try this good plugin, which work with program which accept param lines : Total Converter v1.0.1 :
Yes, but only is possible work with a file at the same time (perhaps I'm mistaken). The idea would be select multiple files (multiples thumbnails) and apply the transformation.

icfu wrote:
For image manipulation you can use ImageMagick, it's command line driven:
http://www.imagemagick.org/
I tried it and several tools: jpegtran, jhead, nconvert, etc. At the moment I work with this toolbar.


Thank you very much to both for the ideas :wink:
I can read English, but... I write like Tarzan. (sorry)
User avatar
byblo
Senior Member
Senior Member
Posts: 270
Joined: 2005-02-20, 21:13 UTC
Contact:

Post by *byblo »

Sombra wrote:Yes, but only is possible work with a file at the same time (perhaps I'm mistaken). The idea would be select multiple files (multiples thumbnails) and apply the transformation.
You mistaken ;) Multiple selection with alt+f9 (by default tc) and choose the output format, like on this sample picture : http://users.skynet.be/fb119101/rlz/wamp.preview0.png

You could set multible files output and extract them using an advanced selection like *.rotloss90.jpg


One example, here is the "content" of my wav "archives" since I've set ctconv :

btada.wav
\Settings\
\tada.(cbr.h.js).mp3
\tada.(vbr1.q1).mp3
\tada.(vbr2.q1).mp3

chimes.wav
\Settings\
\chimes.(cbr.h.js).mp3
\chimes.(vbr1.q1).mp3
\chimes.(vbr2.q1).mp3

To extract both of them, I select tada.wav and chimes.wav, and press alt+f9 to select file to decompress : *.(vbr1.q1).mp3 and it will convert in this case to mp3 vbr1 q1 files only.

edit:jpegtrans seem very interesting.
User avatar
Sombra
Power Member
Power Member
Posts: 814
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Post by *Sombra »

Hi byblo,
I have done a little example following your tips, here is the code:

Code: Select all

<?xml version="1.0" encoding="Windows-1251"?>
<xml>
	<CTConv>
		<FileGroup>
			<jpg>
				<rotate90>
					<outfilename>%in_arch_file_name%.rotloss90.jpg</outfilename>
					<program>jpegtran</program>
					<command> -rotate 90 -copy all "%in_arch_file_path_name_ext%" "%out_arch_file_path_name_ext%"</command>
					<description lng="en">Rotate 90 degrees.</description>
					<ShowConsole>false</ShowConsole>
				</rotate90>
				<rotate270>
					<outfilename>%in_arch_file_name%.rotloss270.jpg</outfilename>
					<program>jpegtran</program>
					<command> -rotate 270 -copy all "%in_arch_file_path_name_ext%" "%out_arch_file_path_name_ext%"</command>
					<description lng="en">Rotate 270 degrees</description>
					<ShowConsole>false</ShowConsole>
				</rotate270>
			</jpg>
		</FileGroup>
		<utilites>
			<jpegtran>
				<exename>jpegtran.exe</exename>
				<path>%commander_path%\Plugins\WCX\CTConv\programm\</path>
				<url>http://sylvana.net/jpegcrop/</url>
				<url>http://sylvana.net/jpegcrop/jpegtran/jpegtran.zip</url>
				<description lng="en">"jpg", Lossless jpeg transformations"</description>
			</jpegtran>
		</utilites>
	</CTConv>
</xml>
and work fine, thx ;).
There is two possibles output files for this code: File.rotloss270.jpg and file.rotloss90.jpg
but... one question: Is possible extract the files with the original input name?
I can read English, but... I write like Tarzan. (sorry)
User avatar
byblo
Senior Member
Senior Member
Posts: 270
Joined: 2005-02-20, 21:13 UTC
Contact:

Post by *byblo »

Sombra wrote:but... one question: Is possible extract the files with the original input name?
Normally yes, but in case of mistake if you try to "extract" the file to itself (same path and name) and if the executable used for conversion didn't load entirely in memory the file before conversion, You'll may get a write access error.
That is why I prefer to give some extra infos to converted files like .rot90., .vbr1., ect... (that permit me also to remember that they aren't the originals ones and what happened to them) Also, its easy to remove massively these extras infos later using tc ;)

edit:Thanks for jpegtran program.
I've using it to rotate a file to 90 and again to 270 to restore it. original and new file are identicals :shock:. sweet!

edit2:after trying other jpg, I noticed that when rotating jpg picture is view with a border 'cutted' which the part appear on the opposite side. Curiously rotating back return to normal view without that problem : http://users.skynet.be/fb119101/temp/JpgRotLossBug.jpg

Same phenomena using lossless rotation from irfanview and a plugin, but in this case the jpg is cutted and part is definetively missing !
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

OT

Post by *XPEHOPE3KA »

2byblo
I guess Harry Potter is studying jpeg-format these days :mrgreen:
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
User avatar
nsp
Power Member
Power Member
Posts: 1917
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

To do all of these transformation, i use ImageMagick and the mogrify command.
But i do not transform any jpeg inside Archive.

I use the thumbmail view and ..
a Bar I load with :
[Rotate Left][Rotate right] | [addShadow] | [reduce size][doTHumbMail] |[->Png][->Jpg][->BMP]....

I select a bunch of file and select the command i want to apply for all of them !

For all these command i use TCBL to build a batFile and launch the mogrify or convert command for each file.

http://www.geocities.com/nospam0123456/forTC
GeminiServer
Junior Member
Junior Member
Posts: 26
Joined: 2005-06-03, 11:04 UTC

Post by *GeminiServer »

This is a very nice plugin!

So otf converting my images.. is more easy..

-> here is my sample code to use the freeware tool "nconvert"

Code: Select all

<?xml version="1.0" encoding="Windows-1251"?>
<xml>
	<CTConv>
		<FileGroup>
		   <jpg>
        <resize100>
           <outfilename>%in_arch_file_name%.res100.jpg</outfilename>
           <program>nconvert</program>
           <command> -quiet -out jpeg -ratio -resize 0 100 -q 100 -o "%out_arch_file_path_name_ext%" "%in_arch_file_path_name_ext%"</command>
           <description lng="en">Resize to 100 px</description>
           <ShowConsole>false</ShowConsole>
        </resize100>
        <resize200>
           <outfilename>%in_arch_file_name%.res200.jpg</outfilename>
           <program>nconvert</program>
           <command> -quiet -out jpeg -ratio -resize 0 200 -q 100 -o "%out_arch_file_path_name_ext%" "%in_arch_file_path_name_ext%"</command>
           <description lng="en">Resize to 300 px</description>
           <ShowConsole>false</ShowConsole>
        </resize200>
        <resize400>
           <outfilename>%in_arch_file_name%.res400.jpg</outfilename>
           <program>nconvert</program>
           <command> -quiet -out jpeg -ratio -resize 0 400 -q 100 -o "%out_arch_file_path_name_ext%" "%in_arch_file_path_name_ext%"</command>
           <description lng="en">Resize to 400 px</description>
           <ShowConsole>false</ShowConsole>
        </resize400>
        <resize600>
           <outfilename>%in_arch_file_name%.res600.jpg</outfilename>
           <program>nconvert</program>
           <command> -quiet -out jpeg -ratio -resize 0 600 -q 100 -o "%out_arch_file_path_name_ext%" "%in_arch_file_path_name_ext%"</command>
           <description lng="en">Resize to 600 px</description>
           <ShowConsole>false</ShowConsole>
        </resize600>
        <resize800>
           <outfilename>%in_arch_file_name%.res800.jpg</outfilename>
           <program>nconvert</program>
           <command> -quiet -out jpeg -ratio -resize 0 800 -q 100 -o "%out_arch_file_path_name_ext%" "%in_arch_file_path_name_ext%"</command>
           <description lng="en">Resize to 800 px</description>
           <ShowConsole>false</ShowConsole>
        </resize800>
        <!-- You can define more... the above sample show you how to resize pictures...-->
        <!-- GeminiServer22/11/2008 -->
     </jpg>
		</FileGroup>
		<utilites>
		  <nconvert>
        <exename>nconvert.exe</exename>
        <path>%commander_path%\Plugins\CTConv\programm\</path>
        <url>http://pagesperso-orange.fr/pierre.g/xnview/enhome.html</url>
        <url>http://pagesperso-orange.fr/pierre.g/xnview/en_nconvert.html</url>
        <description lng="en">"jpg", Perfect Picture converter"</description>
      </nconvert>
		</utilites>
	</CTConv>
</xml>
cheers, GeminiServer
Post Reply