提取/转换已转换的(多文件)图像 [英] Extract/Convert an (multi-file)image that converted

查看:160
本文介绍了提取/转换已转换的(多文件)图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用程序制作的文件,即图像贴纸制造商. 我知道此程序会将其图像(可能是图像,背景和蒙版)保存到扩展名为".adf"的单个文件中.

I have a file made with a program , an image sticker maker . I know this program saves it's images(probably an image, a bg and a mask) into single file with extension ".adf" .

我无法使用以下错误的图像魔术来转换输出文件:

I couldn't convert the output file with image magick cause of below error :

convert: no decode delegate for this image format `output.adf' @ error/constitute.c/ReadImage/532.

我不知道此Image如何通过Image magick转换. 这是我的-list配置结果:

I don't know how this Image converted with Image magick . it's my -list configure result :

Path: [built-in]

Name          Value
-------------------------------------------------------------------------------
NAME          ImageMagick

Path: configure.xml

Name          Value
-------------------------------------------------------------------------------
CC            vs10
COPYRIGHT     Copyright (C) 1999-2011 ImageMagick Studio LLC
DELEGATES     bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
FEATURES      OpenMP
HOST          Windows
LIB_VERSION   0x671
LIB_VERSION_NUMBER 6,7,1,0
NAME          ImageMagick
RELEASE_DATE  2011-07-15
VERSION       6.7.1
WEBSITE       http:// www.image magick.org

我附加了文件: src.adf

*编辑* 如果我在src.adf上运行文件命令,它会告诉您:

* EDIT * if I run file command on src.adf it tells :

root@MexHex-PC:# file -vv src.adf
file-5.25
magic file from /etc/magic:/usr/share/misc/magic

错过了什么! 谢谢

推荐答案

src.adf看起来非常小&平面数据文件.我对Dalahoo3D和/或ArcGis产品一无所知,但我们可以使用python快速提取嵌入式图像.

This src.adf looks like a very minimal & flat data file. I know nothing about Dalahoo3D and/or ArcGis products, but we can quickly extract the embedded images with python.

import struct

with open('src.adf', 'rb') as f:
    # Calculate file size.
    f.seek(0, 2)
    total_bytes = f.tell()
    # Rewind to beging.
    f.seek(0)
    file_cursor = f.tell()
    image_cursor = 0

    while file_cursor < total_bytes:
        # Can for start of JPEG.
        if f.read(1) == b"\xFF":
            if f.read(3) == b"\xD8\xFF\xE0":
                print("JPEG FOUND!")
                # Backup and find the size of the image
                f.seek(-8, 1)
                payload_size = struct.unpack('<I', f.read(4))[0]
                # Write image to disk
                d_filename = 'image{0}.jpeg'.format(image_cursor)
                with open(d_filename, 'wb') as d:
                    d.write(f.read(payload_size))
                image_cursor += 1
            else:
                f.seek(-3, 1)  # Back cursor up, and try again.
        file_cursor = f.tell()

转储以下三个图像...

Which dumps the following three images...

我确定此文件是使用Imagemagick制作的.我已经看到有人会将文件转换为tiff图像.他告诉我要用Imagemagick做到这一点,但没有解释该方法.

I'm sure this file was made with Imagemagick. I had already seen that one would convert the file to tiff image. He told me to do this with Imagemagick but did not explain the method.

我猜这只是沟通不畅的问题.的确,ImageMagick通常处理JPEG/TIFF格式,但不处理地理信息系统和/或3D建模.通常由供应商(例如ArcGIS)进行扩展.我敢打赌ImageMagick会出现在生成TIFF文件的工作流中,但是.ADF有人写了一个委托编码器.

I'm guessing this is just a matter of miscommunication. It's true that ImageMagick commonly handles JPEG / TIFF formats, but not geographic information systems and/or 3D modeling. That's usually extended by a vendor -- like ArcGIS. I would bet that ImageMagick is present in the workflow of generating TIFF files, but .ADF wouldn't be supported by ImageMagick until someone writes a delegate coder.

更新

来自此问题,看起来您需要扩展ImageMagick委托才能调用GDAL实用程序.您需要更新 delegates.xml 文件以调用正确的实用程序.

From this question, it looks like you'll need to extend ImageMagick delegates to call GDAL utilities. You'll need to update the delegates.xml file to call the correct utility.

这篇关于提取/转换已转换的(多文件)图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆