Old JPG files only work with VB6 leadtools - image-processing

I have images that I wanna show it on the web. The extension of the image is .JPG. If you open the file in notepad it starts with LTRI. But that page is not working on browser (even not working on Photos/Paint app of windows 10). It only works on VB6 LeadTools. How can I convert this image? File metadata is below,

You'll need to use the LeadTools libraries. You'll need to register to their site.
I haven't seen anyone else supporting that format, that is proprietary (as written by #Selvin).
Then the code should be easy:
using (RasterCodecs codecs = new RasterCodecs())
{
var image = codecs.Load("yourimage.ext");
// 0 should means "whatever bit format is appropriate"
codecs.Save(image, "out.jpg", Leadtools.RasterImageFormat.Jpeg, 0);
}

The answer posted by xanatos is correct. This appears to be a 1-bit LEAD CMP image file.
We would like to add the following details:
If the images are indeed 1-bit CMP, they would be pure black-and-white, and they would be lossless (unlike color CMP and common JPEG, which are usually lossy formats).
Naming the file aa.JPG is incorrect, since the recommended extension for LEAD images is “.CMP”. However, when using our SDK, the correct format is detected regardless of the file name or its extension.
Converting 1-bit images to JPEG is not recommended, since JPEG files are more suited for full-color images. It’s better to save them as PNG, TIFF or other lossless formats. (The LEADTOOLS SDK supports many such formats).
Using lossless compression shouldn’t produce large files since 1-bit images contain a lot less data than full-color images.
When using the free evaluation of our SDK, technical support is free through chat and email, so feel free to contact us with any questions you have.

Related

Upload images: reduce resolution without loosing quality (Swift)

I have user gallery at remote areas where internet speed is limited. And, they can upload multiple documents when asked.
In that case, when I am not suppressing the document image.. it takes time to upload the document and on the other hand, when I do, document loose readability.
So, here, I am finding the way to upload multiple documents with full resolution but without losing quality.
And, document image can be in any format jpg, jpeg, png etc.
Thanks in advance for your help.
I check this Image upload without loss of quality but didn't help it.
The link is .NET, you need Swift, right?
You have a image named "originalImage". The code below compress this image and create a new, smaller one with same resolution. The value (0.8) is compression level.
Upload "compressedImage" to server.
let compressedImage = UIImageJPEGRepresentation(originalImage, 0.8)

How does one create and display HDR images in web browsers?

Are there any image formats for the web with full HDR image support? 10/12-bit channels, DCI-P3/Rec.2020 colour space, etc.
It seems like none of the conventional formats support it, and no one is talking about it, even when YouTube accepts HDR uploads and HDR monitor adoption is increasing.
I am by no means an expert on this topic, but I found this question while working on a 2021/22 solution to the problem and I'd like to share my thoughts and progress. Maybe somebody gets use out of it.
Trigger HDR mode in the browser
It seems, it's possible to trick browsers on Apple platforms to switch to HDR mode, as documented on kidi.ng/wanna-see-a-whiter-white
There, they use a combination of a tiny HDR video and the CSS properties filter/backdrop-filter with brightness(10) to make HTML elements and their colors reach into HDR space. It works and it is a cool trick, if a bit gimmicky.
AVIF HDR support with PQ
As mentioned by Валерий Заподовников, the AVIF file format seems to support HDR in a sense when the image is tagged PQ (Perceptual quantizer).
I found files provided by Netflix (example) demonstrating this on the AVIF codec Github. They do seem to display brighter than regular CSS content in Chrome (see image) with background-color: white;, but I have not been able to create images like these myself. Also: the PNG images didn't yield the same result for me.
Platform limitations
The experiments did not produce any usable results for me, mainly because I have few HDR capable displays to test on and also, Safari does not support AVIF images yet. It seems, it could be a while before it does, but I'll get back to testing then.
My other hope was that the HDR-capable format that Apple does use, .HEIF/.HEIC, would display in Safari and I could work with that, but it doesn't. And it does not look like it will, since it's not a format engineered for web use.
Y. Mano and colleagues at Netflix investigated just this question. They concluded that several commonly supported image formats (notably JPEG2000 and 16-bit PNG) can support HDR images already, as long as a color profile is embedded in the corresponding images. The article I linked to is also a good introduction to HDR and wide color gamut images in general.

How to convert or manipulate JPEG stored as blob without image library

I have a JPEG image stored in memory as a blob and am looking to apply some basic transformations to it (e.g. resize, convert to greyscale, rotate etc.)
I am currently using Google Scripts which doesn't have a native image library as far as I can tell.
Are there standard algorithms or similar which would allow me to work with the raw binary array, knowing it represents a JPEG image, to achieve such a transformation?
Not the answer you are looking for I guess, but...
To be able to do image processing using JPEG files as input, you need to decode the images. Well, actually, 90/180/270 degree rotation, flipping and cropping is possible as lossless operations, and thus without decoding the image data. But for anything more advanced, like resizing, you need to work with a decoded image.
Both the file structure (JIF/JFIF) and algorithms used to compress the image data in standard JPEG format are well defined and properly documented. But at the same time, the specification is quite complex. It's certainly doable if you have the time and know what you are doing. And if you are lucky, and your JPEG blobs are all written the same way, you might get away with implementing only some of the spec. But even then, you will need to (re-)implement large parts of the spec, and it might just not be worth it.
Using a 3rd party service to convert it for you, or create your own using a known library, like libjpeg or Java's ImageIO, etc. might be your best bets, if you need a quick solution, and don't have too strict requirements for performance.
There are no straightfoward image processing capabilities available in Apps Script. You'll have either expose your Python as a web service and call it from Apps Script or use the Drive REST API to access the files from your Python app or use any api webservices.
GAE Python has Image processing capabilities check the below url:
https://developers.google.com/appengine/docs/python/images/
Available image transformations
The Images service can resize, rotate, flip, and crop images, and enhance photographs. It can also composite multiple images into a single image.

Convert Doc,Docx to TIFF with delphi

Hi
How can i convert doc,docx to TIFF whith delphi?
In short, you can't.
Doc and TIFF are two completely different things. It's not like converting from BMP to TIFF (two image formats), or WAV to MP3 (two audio formats). For very limited Word documents, I suppose you could run Word through OLE automation (or maybe even embed Word in your application for better control), then take a screenshot, but I think your problems runs deeper than that. Maybe you could provide some more info about what you try to achieve?
I've done it from within Word, however the code is long lost I'm sorry.
I created an Office plugin using the Add-in Express Component.
I used Word automation to convert the current document to RTF, used WP-Tools to render, which gave me the bitmap for each page. Finally I used GDI+ to create the multi-page TIFF.
The standard trick is like with word to pdf: find a virtual printer that outputs tiffs, and instrument word over OLE to print to the virtual printer.
If I put "tiff printer virtual" in google, I see quite some hits. (not all free though, and of course it complicates installation to use two programs (word+printer) to do this)
Word is not able to save its documents to TIFF format. Your best options are to use third party software which can do that. Just google for Doc to Tiff.
When looking for tools to do this, you should also be aware that not all TIFF files are faxable. TIFF files can contain a whole range of image formats and sizes. You need to find a tool which can convert your document to monochrome bitmaps 1728 pixels wide, with the page images each in a single strip and with a compression method supported by your fax software.
A good fax software usually comes with a fax printer driver, check with the maker of your fax software if they have one. With a driver you can simply use OLE Automation to make Word print the document to this driver. The fax software we use expects the fax number and other parameters embedded in the text like this: ##NUMBER12345678##

JPEG built-in checksum / fingerprint?

I'm putting together a script to find remove duplicates in a large library of images. At the moment I'm doing a two pass filter of first finding files of the same size and then doing a sha256 on a 10240 byte piece of the file to get a fingerprint of the files with the same size (code here).
It works well, but I'm guessing there are probably checksums built in to the jpeg format that I could use instead of doing the sha256.
Does anyone know if there are checksums or other components that could act as checksums / fingerprints? If so, is there an efficient way to access them?
I don't think the JPEG specification includes any kind of checksum in the way you're describing.
A JPEG can contain a thumbnail as part of its EXIF metadata, though. It's not a perfect indicator, since it's possible for two different images to have the same thumbnail. There's at least one documented case of a thumbnail not being replaced after the image had undergone substantial modifications, said thumbnail revealing much more than the publisher had intended.
Its been awhile since I've dug into the IJG library, but I don't think there's an easy class member or function call you can use there to check for some type of fingerprint. You could use the built in EXIF tags if you can control the encoding of the images...
I'm just built a very similar script. I don't want to checksum metadata I want to see if the actual images are duplicates even if tags have been modified. Best for that is not to sort by size, but do sort by the checksum istelf. I use jhead to remove metadata and then checksum the whole file (but I also thought about just doing part of it, but actually I don't think it saves much time). jhead doesn't use shared memory (pipes) and does overwrite so I just copy the file to shared memory first. I place the checksum in the ImageDescription field for later faster retrieval. Obviously this also allows to check image integrity later and is part of why I checksum the whole thing. Tip: exiv2 is MUCH faster for reading and writing the metadata than exiftool for one at a time decision based manipulation.
In JPEG standard(ITU-T.81) i believe there isn't any field/syntax element which has a checksum or such, for the whole compressed jpeg image file. Unless a customised application puts such filed in the Application segment, or as meta data for which segments are provided in the standard.
So to serve your purpose, what you are doing is one soln.
Other could be some kind a application wrapper which will call some binary file compare utlitiy (like beyond compare, or even a windows command fc /b) and check the result of that compare utility and take the decision u want to.
-AD
One way you could perform is reduce all images to a fixed size and store that as a thumbnail. Then the image comparison would compare similar sized images and give you a chance of being a duplicate - useful if you have cropped (unless cropped heavily) or resized images and want to find those 'duplicates'.
In the XMP specification there are document ID and version ID which should uniquely identify the version of the image.
The problem with these (and with any other metadata-based identification method) is that it might not be respected by some applications that can change the content of the jpeg updating the metadata accordingly.

Resources