Solved Remove white area around jpeg images (1 Viewer)

wackywoo105

Registered User.
Local time
Today, 08:18
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
 

wackywoo105

Registered User.
Local time
Today, 08:18
Joined
Mar 14, 2014
Messages
203
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:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:18
Joined
Feb 19, 2002
Messages
43,493
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.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 11:18
Joined
May 21, 2018
Messages
8,605
Works for me.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:18
Joined
Feb 19, 2002
Messages
43,493
As long as you are OK with being the product, use whatever you want.
 

wackywoo105

Registered User.
Local time
Today, 08:18
Joined
Mar 14, 2014
Messages
203
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

Top Bottom