Jump to content

need easy bmp->jpeg converter function


Cyber
 Share

Recommended Posts

I found also ImageMagick.

I don't know how to use it but it is consider very powerful..

http://www.imagemagick.org/Usage/

ImageMagick would probably be a good choice. Its "convert" function is a DOS program that can convert just about any image format to another. There are APIs for several programming languages, including C and Java. And, it is well documented. I used something like the following AutoIt syntax to crop and resize. A conversion should be similar. The input file name is on the left, the output file name is on the right and the operation is in the middle.

$strBase = 'C:\Documents and Settings\User\Desktop'

$strImageIn = 'Input.gif'

$strImageOut = 'Output.gif'

$strCmd = @ComSpec & ' /c ' & 'convert ' & $strImageIn & ' -crop 445x405!+175+45 -resize 320x240! ' & $strImageOut

$handleRun = RunWait( $strCmd, $strBase, @SW_HIDE )

Link to comment
Share on other sites

ImageMagick would probably be a good choice. Its "convert" function is a DOS program that can convert just about any image format to another. There are APIs for several programming languages, including C and Java. And, it is well documented. I used something like the following AutoIt syntax to crop and resize. A conversion should be similar. The input file name is on the left, the output file name is on the right and the operation is in the middle.

$strBase = 'C:\Documents and Settings\User\Desktop'

$strImageIn = 'Input.gif'

$strImageOut = 'Output.gif'

$strCmd = @ComSpec & ' /c ' & 'convert ' & $strImageIn & ' -crop 445x405!+175+45 -resize 320x240! ' & $strImageOut

$handleRun = RunWait( $strCmd, $strBase, @SW_HIDE )

I don't know Imagemagic but it looks like 'imageMagic' should appear in the RunWait shouldn't it?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

No third party exe needed.. A3Lib..

Crude no error checking example, just to show..

#include <A3LGDIPlus.au3>

Global $hImage, $sCLSID
_GDIP_StartUp()
$hImage = _GDIP_ImageLoadFromFile(@ScriptDir & "\your.bmp")
$sCLSID = _GDIP_EncodersGetCLSID("JPG")
_GDIP_ImageSaveToFileEx($hImage, @ScriptDir & "\your.jpg", $sCLSID)
_GDIP_ShutDown()

Cheers

Edited by smashly
Link to comment
Share on other sites

No third party exe needed.. A3Lib..

Crude no error checking example, just to show..

#include <A3LGDIPlus.au3>

Global $hImage, $sCLSID
_GDIP_StartUp()
$hImage = _GDIP_ImageLoadFromFile(@ScriptDir & "\your.bmp")
$sCLSID = _GDIP_EncodersGetCLSID("JPG")
_GDIP_ImageSaveToFileEx($hImage, @ScriptDir & "\your.jpg", $sCLSID)
_GDIP_ShutDown()

Cheers

Thanks!

But i cant install autoit3lib...

the error installation message:

Auto3Lib require at last version 3.2.4.9 of AutoIt.

Yout version is 3.2.6.0

.....

can you please attach (at this post) the A3LGDIPlus.au3 file please? :)

thanks!

Edited by Cyber
Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
Link to comment
Share on other sites

Thanks!

But i cant install autoit3lib...

the error installation message:

Auto3Lib require at last version 3.2.4.9 of AutoIt.

Yout version is 3.2.6.0

.....

can you please attach (at this post) the A3LGDIPlus.au3 file please? :)

thanks!

I don't think that PaulIA will like you posting parts of the library here.

Try this temporary fix http://www.autoitscript.com/forum/index.ph...mp;#entry393902

Link to comment
Share on other sites

I don't know Imagemagic but it looks like 'imageMagic' should appear in the RunWait shouldn't it?

The ImageMagick image conversion utility is called "convert.exe".

ImageMagick includes a library of command-line utilities:

- animate: animates an image sequence on any X server.

- compare: mathematically and visually annotate the difference between an image and its reconstruction.

- composite: overlaps one image over another.

- conjure: interprets and executes scripts written in the Magick Scripting Language (MSL).

- convert: convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.

- display: displays an image or image sequence on any X server.

- identify: describes the format and characteristics of one or more image files.

- import: saves any visible window on an X server and outputs it as an image file.

- mogrify: resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.

- montage: create a composite image by combining several separate images.

- stream: streams pixels to a storage format

See: http://www.imagemagick.org/script/command-line-tools.php

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...