Solved Remove white area around jpeg images (1 Viewer)

wackywoo105

Registered User.
Local time
Today, 00:00
Joined
Mar 14, 2014
Messages
203
I'm loading some images into access image process. They are signatures on a pure white background. I want to remove the excess white area around the signature so it is cropped to just the size of the signature.

Is there a way to do this with VBA? If not are there any utilities that can be run from command line that would work?

Code:
Dim wiaImg As New WIA.ImageFile
Dim IP As ImageProcess

wiaImg.LoadFile SiganutureToUse

Set IP = CreateObject("WIA.ImageProcess")
IP.Filters.Add (IP.FilterInfos("Convert").FilterID)
IP.Filters(1).Properties("FormatID").Value = WIA.FormatID.wiaFormatJPEG
IP.Filters(1).Properties("Quality").Value = 25
Set wiaImg = IP.Apply(wiaImg)

wiaImg.SaveFile sigfile
 
I've searched and found a few programs, but nothing that seems suitable. I will have a look at imagemagick thanks.

EDIT: Thanks that looks good so far. I'm interested in the portable version but a bit bamboozled by all the different options.

EDIT2: Can't seem to download:

Your connection isn't private
Attackers might be trying to steal your information from download.imagemagick.org (for example, passwords, messages or credit cards).
NET::ERR_CERT_COMMON_NAME_INVALID
This server couldn't prove that it's download.imagemagick.org; its security certificate is from imagemagick.net. This may be caused by a misconfiguration or an attacker intercepting your connection.

EDIT3: I managed to get round that but no files will download.

EDIT4: Managed to download. The convert can be used on its own. Works perfectly. Big thanks.
 
Last edited:
I don't know anything about the imagemagic but I shy away from "free" stuff. NOTHING is actually free. If you are not paying with money for a product, then YOU are the product.
 
Works for me.
 
As long as you are OK with being the product, use whatever you want.
 
I have this set up now and it works fine. I just used the "convert.exe" from the portable version of imagmagik, so no installation required. There doesn't appear to be anything suspicious about it so far.
 

Users who are viewing this thread

Back
Top Bottom