RU2469400C1 - Method to convert bitmapped image into metafile - Google Patents

Method to convert bitmapped image into metafile Download PDF

Info

Publication number
RU2469400C1
RU2469400C1 RU2011146617/08A RU2011146617A RU2469400C1 RU 2469400 C1 RU2469400 C1 RU 2469400C1 RU 2011146617/08 A RU2011146617/08 A RU 2011146617/08A RU 2011146617 A RU2011146617 A RU 2011146617A RU 2469400 C1 RU2469400 C1 RU 2469400C1
Authority
RU
Russia
Prior art keywords
metafile
color
background
region
commands
Prior art date
Application number
RU2011146617/08A
Other languages
Russian (ru)
Inventor
Илья Васильевич Курилин
Илья Владимирович Сафонов
Хокеун ЛИ
Original Assignee
Корпорация "САМСУНГ ЭЛЕКТРОНИКС Ко., Лтд."
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Корпорация "САМСУНГ ЭЛЕКТРОНИКС Ко., Лтд." filed Critical Корпорация "САМСУНГ ЭЛЕКТРОНИКС Ко., Лтд."
Priority to RU2011146617/08A priority Critical patent/RU2469400C1/en
Priority to KR1020120035063A priority patent/KR101869302B1/en
Priority to US13/670,973 priority patent/US20130128324A1/en
Priority to EP12193139.8A priority patent/EP2597616A3/en
Application granted granted Critical
Publication of RU2469400C1 publication Critical patent/RU2469400C1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/46Colour picture communication systems
    • H04N1/56Processing of colour picture signals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/20Contour coding, e.g. using detection of edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Image Generation (AREA)
  • Image Processing (AREA)

Abstract

FIELD: printing industry.
SUBSTANCE: background area is detected in a bitmapped image; a background type is detected; a command is saved into a metafile, which relates to background display; multicoloured areas are detected in a bitmapped image; multicoloured areas are saved into a metafile as a command related to display of bitmapped image fragments; single-coloured areas are detected in a bitmapped image; a command is saved into a metafile related to display of single-coloured areas.
EFFECT: provision of high quality of display of a bitmapped image converted into a metafile, with considerable reduction of saved data volume compared to memory volume required to store an initial digital bitmapped image.
7 cl, 17 dwg

Description

Изобретение относится к технологиям обработки цифровых изображений, а более конкретно - к способам преобразования растровых изображений в электронный формат.The invention relates to digital image processing technologies, and more particularly, to methods for converting raster images to electronic format.

Современные способы преобразования растровых изображений в электронный формат, удобный для их хранения и воспроизведения, сталкиваются с необходимостью решения двух зачастую противоречащих друг другу задач. Первая задача заключается в необходимости сохранения информации в формате, требующем как можно меньшего объема памяти. Вторая задача заключается в предотвращении деградации (значительного ухудшения) исходного изображения в результате его преобразования в электронный формат. Одним из наиболее распространенных способов такого преобразования изображений является технология Mixed Raster Content (MRC) (см. например, OSO/IES JTC1/SC29/WG1 N542, "ITU-T Mixed Raster Content model as JPEG 2000 Architectural Framework," June 30, 1997) [1], которая позволяет уменьшить размер результирующего файла за счет использования многослойной модели представления изображения и разных методов компрессии, ориентированных на сжатие каждого слоя наиболее подходящим для этой цели образом. Однако алгоритмы MRC не учитывают особенностей отображения векторной графики, присутствующей на исходном растровом изображении. Если, например, в исходном электронном текстовом документе отображение и печать символов не зависит от их масштаба, то отображение символов сканированного текстового документа, преобразованного с помощью MRC, будет зависеть от масштаба их воспроизведения. Также стоит отметить, что известные методы многослойного анализа и сохранения растровых изображений в электронном виде выделяют все растровые изображения в отдельный слой. Таким образом, даже если на исходном изображении будут присутствовать только незначительные элементы растровой графики, в результирующем документе будет сохранен растровый слой, размер которого сопоставим с размером всего документа.Modern methods of converting raster images into an electronic format convenient for storing and reproducing them are faced with the need to solve two often conflicting tasks. The first task is the need to save information in a format that requires as little memory as possible. The second task is to prevent degradation (significant deterioration) of the original image as a result of its conversion to electronic format. One of the most common methods for such image conversion is Mixed Raster Content (MRC) technology (see, for example, OSO / IES JTC1 / SC29 / WG1 N542, "ITU-T Mixed Raster Content model as JPEG 2000 Architectural Framework," June 30, 1997 ) [1], which allows reducing the size of the resulting file through the use of a multilayer image representation model and various compression methods oriented to compressing each layer in the most suitable way for this purpose. However, MRC algorithms do not take into account the features of the display of vector graphics present on the original bitmap image. If, for example, in the original electronic text document, the display and printing of characters does not depend on their scale, then the display of the characters of the scanned text document converted by MRC will depend on the scale of their reproduction. It is also worth noting that the well-known methods of multilayer analysis and preservation of raster images in electronic form separate all raster images into a separate layer. Thus, even if only minor elements of the raster graphics are present on the original image, a raster layer with a size comparable to the size of the entire document will be saved in the resulting document.

Из уровня техники известен, в частности, способ уменьшения размера файла, раскрытый в патентной заявке США №20110007334 [2]. В этом техническом решении предложены способ и система для векторизации текста на сканированном изображении. Авторами раскрывается способ векторизации, обеспечивающий гладкое отображение символов. Недостатком такого решения является то, что анализируется только тест, присутствующий на сканированном изображении, и соответственно процедура векторизации рассматривается независимо от остальных элементов изображения.In the prior art, in particular, a method for reducing file size disclosed in US patent application No. 20110007334 [2] is known. This technical solution proposes a method and system for vectorizing text on a scanned image. The authors disclose a vectorization method that provides a smooth display of characters. The disadvantage of this solution is that only the test present on the scanned image is analyzed, and accordingly, the vectorization procedure is considered independently of the rest of the image elements.

Наиболее близкими к заявляемому изобретению признаками обладает способ, описанный в патенте США №7289122 [3]. Способ основан на применении аппроксимации формы графических объектов с помощью кривых Безье. Недостатком такого решения является то, что авторами раскрывается только способ аппроксимации, при этом преобразование всего изображения в форму электронного документа не рассматривается.Closest to the claimed invention features has the method described in US patent No. 7289122 [3]. The method is based on the application of approximation of the shape of graphic objects using Bezier curves. The disadvantage of this solution is that the authors disclose only the approximation method, while the conversion of the entire image to the form of an electronic document is not considered.

Задача, на решение которой направлено заявляемое изобретение, заключается в разработке усовершенствованного способа преобразования растрового изображения в метафайл. Заявляемый способ должен обеспечивать повышенное качество отображения растрового изображения, преобразованного в метафайл, при значительном уменьшении объема сохраняемых данных в сравнении с объемом памяти, требуемым для хранения исходного цифрового растрового изображения.The problem to which the invention is directed, is to develop an improved method for converting a raster image to a metafile. The inventive method should provide improved display quality of the bitmap converted to a metafile, while significantly reducing the amount of data stored in comparison with the amount of memory required to store the original digital bitmap.

Технический результат достигается за счет применения способа преобразования растрового изображения в метафайл, который включает в себя выполнение следующих операций:The technical result is achieved through the application of a method of converting a raster image to a metafile, which includes the following operations:

- выявляют на растровом изображении области фона;- reveal the background area on the raster image;

- определяют тип фона;- determine the type of background;

- сохраняют в метафайл команды, касающиеся отображения фона;- save the commands related to the display of the background in the metafile;

- выявляют на растровом изображении многоцветные области;- multicolor areas are detected on the raster image;

- сохраняют многоцветные области в метафайл как команды, касающиеся отображения фрагментов растрового изображения;- save multi-color areas in the metafile as commands relating to the display of fragments of the bitmap image;

- выявляют на растровом изображении одноцветные области;- single-color areas are detected on the raster image;

- сохраняют в метафайл команды, касающиеся отображения одноцветных областей.- save the commands related to the display of monochrome areas into the metafile.

Получаемый в результате метафайл комбинирует в себе как растровое, так и векторное описание визуальной информации. Эффективное преобразование исходного растрового изображения в метафайл, с точки зрения отношения качества отображения к объему сохраняемых данных, достигается за счет комбинирования наиболее подходящих приемов преобразования и сохранения данных, соответствующих конкретным категориям областей на изображении. Например, фрагменты растровой графики, присутствующие на исходном изображении и включающие в себя иллюстрации, фотографии, рисунки, локализуются и сохраняются независимо друг от друга в метафайл. Элементы векторной графики, как, например, линии, таблицы, текст, логотипы и т.п. выявляются и преобразовываются в векторный формат посредством описания их формы и цвета графическими командами метафайла.The resulting metafile combines both raster and vector descriptions of visual information. Effective conversion of the original raster image into a metafile, from the point of view of the ratio of display quality to the amount of stored data, is achieved by combining the most suitable methods for converting and storing data corresponding to specific categories of areas in the image. For example, fragments of bitmap graphics present in the original image and including illustrations, photographs, drawings, are localized and stored independently in the metafile. Vector graphics elements, such as lines, tables, text, logos, etc. they are detected and converted into a vector format by describing their shape and color with the metafile graphic commands.

Таким образом, заявляемый способ объединяет в себе два основных этапа. Первый этап заключается в выявлении областей предопределенных категорий на исходном растровом изображении. К таким категориям отнесены: фон изображения, многоцветные и одноцветные области. Второй этап включает в себя эффективное описание каждой из категорий областей соответствующими командами метафайла и их сохранение. Фон изображения описывается командами метафайла в зависимости от его типа. Например, одноцветный фон задается командой, определяющей его цвет, многоцветный фон представляет собой фоновое растровое изображение, размер которого соответствует размеру отображаемого документа. Многоцветные локальные области сохраняются в метафайл как фрагменты растровых изображений, местоположение которых и размер задаются соответствующими командами метафайла. Кроме того, форма непрямоугольных многоцветных областей задается соответствующими областями отсечения, описываемыми графическими командами метафайла. Одноцветные области изображения сохраняются в метафайл в векторном виде с помощью соответствующих графических команд метафайла.Thus, the claimed method combines two main stages. The first step is to identify areas of predefined categories in the original bitmap. These categories include: background images, multicolor and monochrome areas. The second stage includes an effective description of each of the categories of areas with the corresponding metafile commands and their preservation. The background of the image is described by the metafile commands depending on its type. For example, a single-color background is set by a command that determines its color, a multi-color background is a background bitmap image whose size corresponds to the size of the displayed document. Multicolor local areas are saved in the metafile as fragments of raster images, the location and size of which are set by the corresponding metafile commands. In addition, the shape of non-rectangular multicolor regions is defined by the corresponding clipping regions described by the graphic metafile commands. Monochrome areas of the image are saved to the metafile in vector form using the corresponding graphic metafile commands.

Далее существо заявляемого изобретения поясняется с привлечением графических материалов.Further, the essence of the claimed invention is illustrated with the use of graphic materials.

Фиг.1 Блок-схема, иллюстрирующая принцип преобразования растрового изображения в метафайл.Figure 1 A block diagram illustrating the principle of converting a raster image to a metafile.

Фиг.2 Пример растрового изображения с различными типами областей.Figure 2 An example of a bitmap with various types of areas.

Фиг.3 Пример наложения областей в ходе отображения метафайла.Figure 3 An example of overlapping areas during the display of the metafile.

Фиг.4 Иллюстрация системы для преобразования растровых изображений в метафайл.Figure 4 Illustration of a system for converting raster images to metafile.

Фиг.5 Блок-схема процесса сохранения многоцветной области в метафайл.5 A flowchart of a process for storing a multicolor region in a metafile.

Фиг.6 Блок-схема процесса сохранения одноцветной области в метафайл.6 A flowchart of a process for storing a single-color region in a metafile.

Фиг.7 Пример определения внешнего контура области.Fig. 7 An example of determining the external contour of a region.

Фиг.8 Иллюстрация методики определения сегментов предполагаемых ключевых точек контура.Fig. 8 An illustration of a technique for determining segments of prospective key contour points.

Фиг.9 Иллюстрация процесса определения ключевых точек контуров на примере одноцветной области.Fig.9 Illustration of the process of determining the key points of the contours on the example of a single-color region.

Фиг.10 Пример упрощенных контуров одноцветной области.Figure 10 An example of simplified contours of a single-color region.

Фиг.11 Блок-схема процесса аппроксимации упрощенного контура области последовательностью отрезков прямых и кривых.11 Block diagram of the approximation process of the simplified contour of the region by a sequence of line segments and curves.

Фиг.12 Пример корректировки координат ключевых точек упрощенного контура.Fig. 12 Example of adjustment of coordinates of key points of a simplified contour.

Фиг.13 Пример кривых Безье.Fig. 13 Example of Bezier curves.

Фиг.14 Иллюстрация процесса вычисления контрольных точек кривой Безье.Fig. 14 Illustration of a process for calculating control points of a Bezier curve.

Фиг.15 Иллюстрация процесса аппроксимации кривой Безье.Fig. 15 Illustration of the approximation of a Bezier curve.

Фиг.16 Пример аппроксимации контуров одноцветной области последовательностью кривых Безье.Fig. 16 Example of approximation of the contours of a single-color region by a sequence of Bezier curves.

Фиг.17 Примеры исходных одноцветных областей и результатов их отображения путем проигрывания метафайла.Fig. 17 Examples of the original monochrome areas and the results of their display by playing the metafile.

Для однозначного толкования используемых здесь и далее терминов следует уточнить, что под метафайлом обычно понимается формат таких файлов, в которых хранятся данные различных типов, в частности растровые и векторные типы данных. Как правило, структура метафайла представляет собой последовательность (список) команд (записей метафайла) с возможным набором аргументов. При исполнении (проигрывании) метафайла каждая команда выполняет определенное действие, например визуализацию (отрисовку) отрезка линии, отображение фрагмента растрового изображения и т.д. В качестве неограничивающего примера можно упомянуть метафайлы, представленные форматами PDF, XPS, PS, EMF и т.п.For an unambiguous interpretation of the terms used hereinafter, it should be clarified that a metafile usually refers to the format of such files that store data of various types, in particular raster and vector data types. Typically, a metafile structure is a sequence (list) of commands (metafile records) with a possible set of arguments. When executing (playing) a metafile, each command performs a specific action, for example, rendering (drawing) a line segment, displaying a fragment of a raster image, etc. As a non-limiting example, we can mention metafiles represented in PDF, XPS, PS, EMF, etc.

Ключевые этапы преобразования растрового изображения в метафайл проиллюстрированы на Фиг.1. Исходное растровое изображение 101 может быть получено от любого устройства, подходящего для захвата или приема растрового изображения. На этапе 102 выполняется выявление областей фона изображения и определение типа фона. В предпочтительном варианте реализации заявленного способа фон представляет собой области изображения, образующие задний план и соотнесенные с одной из трех предопределенных категорий: одноцветный фон, градиентный фон и многоцветный фон. К одноцветному фону относятся, в частности, области заднего плана изображения, характеризуемые приблизительно одинаковым уровнем яркости и цвета. К градиентному фону относятся, в частности, области изображения с равномерным изменением яркости и цвета, причем такое изменение описывается конкретной функцией. К многоцветному фону относятся области заднего плана растрового изображения, которые не могут быть отнесены к одноцветному или градиентному фону. Например, фоновое растровое изображение, в том числе текстура, может быть классифицировано как многоцветной фон. Выявленный фон описывается с помощью команд метаязыка, соответствующих выбранному формату метафайла. В качестве неограничивающего примера можно упомянуть возможные команды метафайла для каждой категории фона. Одноцветный фон определяется командами метафайла, указывающими цвет фона. Для градиентного фона команды метафайла определяют тип градиентного преобразования, направление градиентного перепада и диапазон яркости или цвета. Многоцветному фону соответствует фоновое растровое изображение, сохраненное в метафайле. В зависимости от варианта осуществления заявленного способа фон может быть заменен на прозрачный, не отображаемый при исполнении (проигрывании) метафайла. Подобный вариант может быть осуществлен в виде настроек устройства или системы, реализующих заявленный способ. На этапе 104 осуществляется выявление многоцветных областей, содержащих растровые изображения или сложную графику. В данном случае под многоцветной областью понимается группа связных пикселей (точек) растрового изображения, локализованных в некоторой части исходного растрового изображения. Обнаруженные многоцветные области сохраняются в метафайл 105 как растровые изображения, сопровождаемые соответствующими командами метафайла, описывающими параметры каждой многоцветной области и их положение на изображении. На этапе 106 осуществляют выявление связных одноцветных областей, то есть областей с приблизительно одинаковой яркостью и цветом. На этом этапе одноцветные области описываются набором графических команд метафайла, реализующих отображение элементов векторной графики, аппроксимирующих форму этих областей. Результат векторного описания одноцветных областей сохраняется в метафайл на этапе 107. В предпочтительном варианте осуществления заявляемого способа для уменьшения размера метафайла используются технологии компрессирования, при этом записи метафайла компрессируются без потерь, а для растровых изображений, сохраняемых в метафайл, допускается компрессия с потерей качества.The key steps of converting a bitmap image to a metafile are illustrated in FIG. The original bitmap 101 may be obtained from any device suitable for capturing or receiving a bitmap. At step 102, identifying areas of the background image and determining the type of background is performed. In a preferred embodiment of the inventive method, the background is image areas forming a background and correlated with one of three predefined categories: a single-color background, a gradient background, and a multi-color background. The monochrome background includes, in particular, background areas of the image characterized by approximately the same level of brightness and color. The gradient background includes, in particular, image areas with a uniform change in brightness and color, moreover, such a change is described by a specific function. A multicolor background includes background areas of a raster image that cannot be assigned to a monochrome or gradient background. For example, a background bitmap, including texture, can be classified as a multicolor background. The detected background is described using metalanguage commands corresponding to the selected metafile format. As a non-limiting example, we can mention the possible metafile commands for each background category. A single-color background is defined by metafile commands that indicate the background color. For a gradient background, the metafile commands determine the type of gradient transformation, the direction of the gradient drop, and the range of brightness or color. A multicolor background corresponds to a background bitmap saved in a metafile. Depending on the embodiment of the inventive method, the background may be replaced with a transparent one that is not displayed during the execution (playback) of the metafile. A similar option can be implemented in the form of settings of a device or system that implements the claimed method. At step 104, multi-color areas containing raster images or complex graphics are detected. In this case, a multicolor region refers to a group of connected pixels (dots) of a raster image localized in some part of the original raster image. Detected multicolor regions are stored in the metafile 105 as bitmap images, followed by the corresponding metafile commands describing the parameters of each multicolor region and their position in the image. At step 106, connected monochromatic areas, that is, areas with approximately the same brightness and color, are detected. At this stage, monochrome areas are described by a set of graphic metafile commands that implement the display of vector graphics elements approximating the shape of these areas. The result of the vector description of monochrome areas is stored in the metafile at step 107. In a preferred embodiment of the proposed method, compression technologies are used to reduce the size of the metafile, while metafile records are compressed without loss, and compression with loss of quality is allowed for bitmaps stored in the metafile.

Заявляемый способ обеспечивает эффективный подход к преобразованию растровых изображений в метафайл с точки зрения отношения качество отображения к размеру файла. Это достигается за счет сохранения каждого типа визуальной информации наиболее подходящим для этого способом. В частности, векторное описание одноцветных областей обеспечивает независимость их отображения от масштаба визуализации или, например, масштаба печати. Для обычных растровых изображений увеличение масштаба приводит к деградации их отображения.The inventive method provides an effective approach to converting raster images to a metafile in terms of the ratio of display quality to file size. This is achieved by storing each type of visual information in the most appropriate way. In particular, the vector description of monochrome areas ensures that their display is independent of the visualization scale or, for example, the print scale. For ordinary bitmap images, zooming in causes degradation of their display.

Фиг.2 иллюстрирует пример растрового изображения. На рисунке помечены основные категории областей, описанные в заявляемом способе: фон 201, одноцветные области 202 и 205, прямоугольная многоцветная область 203 и непрямоугольная многоцветная область 204.Figure 2 illustrates an example of a bitmap image. The figure shows the main categories of regions described in the claimed method: background 201, monochrome areas 202 and 205, rectangular multicolor region 203 and non-rectangular multicolor region 204.

Фиг.3 иллюстрирует порядок визуализации каждой категории областей при проигрывании (воспроизведении) метафайла. В данном случае порядок сохранения областей, иллюстрированный на Фиг.1, соответствует порядку их визуализации. В качестве примера можно пояснить, что визуализация метафайлов часто происходит путем наложения друг на друга прозрачных или полупрозрачных слоев или областей. В процессе отображения метафайла фон 303 является нижним слоем, на который накладываются многоцветные области 302, а затем одноцветные области 301.Figure 3 illustrates the visualization order of each category of areas when playing (playing) a metafile. In this case, the order of preservation of the areas illustrated in FIG. 1 corresponds to the order of their visualization. As an example, we can clarify that the visualization of metafiles often occurs by superimposing on each other transparent or translucent layers or areas. In the process of displaying the metafile, background 303 is the bottom layer onto which the multi-color areas 302 and then the single-color areas 301 are superimposed.

Фиг.4 схематично иллюстрирует вычислительную систему, реализующую заявляемый способ. Вычислительная система, осуществляющая преобразование растровых изображений в метафайл, включает в себя: устройство 402 для ввода исходного растрового изображения, процессор 403 и память 404, хранящую инструкции программы 405, осуществляющей заявляемый способ. Передача данных между модулями системы осуществляется посредством шины 401 передачи данных. В качестве неограничивающего примера осуществления заявляемого способа устройством 402 ввода может быть: сканер, цифровой фотоаппарат, буфер памяти, хранящий скриншот (снимок экрана) и т.д. Метафайл, полученный в результате выполнения инструкций программы, сохраняется в память, откуда в дальнейшем он может быть передан, например, на устройство печати, устройство визуализации, записан в устройство хранения данных и т.д. Проиллюстрированы только те признаки, которые упомянуты в описании. Однако следует понимать, что вычислительная система может иметь дополнительные признаки, которые не были отражены на иллюстрации. Вычислительная система может быть представлена, например, персональным компьютером, мобильным телефоном, телевизором, многофункциональным печатающим устройством или быть любым другим электронным устройством.Figure 4 schematically illustrates a computing system that implements the inventive method. A computing system that converts raster images to a metafile includes: a device 402 for inputting an initial raster image, a processor 403 and a memory 404 that stores instructions of a program 405 implementing the inventive method. Data transfer between the system modules is carried out via the data bus 401. As a non-limiting example of the implementation of the proposed method, the input device 402 can be: a scanner, a digital camera, a memory buffer that stores a screenshot (screenshot), etc. The metafile obtained as a result of executing the instructions of the program is stored in memory, from where it can later be transferred, for example, to a printing device, visualization device, recorded in a data storage device, etc. Only those features that are mentioned in the description are illustrated. However, it should be understood that the computing system may have additional features that were not reflected in the illustration. The computing system can be represented, for example, by a personal computer, mobile phone, television, multifunction printing device, or any other electronic device.

На Фиг.5 схематически иллюстрированы основные шаги, обеспечивающие в совокупности сохранение в метафайл каждой выявленной многоцветной области. На шаге 501 определяют ограничивающий прямоугольник анализируемой многоцветной области. Ограничивающий прямоугольник описывает пиксели многоцветной области в соответствии с ее положением на исходном изображении, включая определение угла скоса области. Это позволяет уменьшить размер изображения, сохраняемого в метафайл. Шаг 502 направлен на определение формы многоцветной области. В предпочтительном варианте осуществления заявляемого способа многоцветная область является прямоугольной или непрямоугольной (произвольной) формы. Более точное отображение многоцветной области непрямоугольной формы достигается за счет определения ее области отсечения на шаге 503. Необходимость такого шага связана с тем, что в метафайл может быть сохранено только прямоугольное изображение. Область отсечения позволяет скрыть неотображаемые участки сохраненного фрагмента растрового изображения для непрямоугольной многоцветной области. Более подробно этот шаг будет описан ниже. Шаг 504 обеспечивает масштабирование фрагмента входного растрового изображения. Местоположение фрагмента определяется координатами ограничивающего прямоугольника.Figure 5 schematically illustrates the main steps that ensure in the aggregate the preservation in the metafile of each identified multicolor region. At step 501, the bounding rectangle of the analyzed multicolor region is determined. The bounding box describes the pixels of the multicolor region in accordance with its position in the original image, including the definition of the bevel angle of the region. This allows you to reduce the size of the image stored in the metafile. Step 502 aims to determine the shape of the multicolor region. In a preferred embodiment of the proposed method, the multicolor region is rectangular or non-rectangular (arbitrary) in shape. A more accurate display of a non-rectangular multi-color region is achieved by defining its clipping region in step 503. The need for this step is due to the fact that only a rectangular image can be saved in the metafile. The clipping region allows you to hide the non-displayed portions of the saved fragment of the raster image for a non-rectangular multicolor region. This step will be described in more detail below. Step 504 zooms in on a portion of the input bitmap. The location of the fragment is determined by the coordinates of the bounding box.

Масштабирование, как правило, выполняется в направлении уменьшения размера исходного изображения к предопределенному размеру, предпочтительному для последующего воспроизведения метафайла. Например, исходное растровое изображение, сканированное с разрешением 300 dpi (точек на дюйм), может быть приведено к разрешению 72 или 96 dpi, соответствующему разрешению дисплея. На шаге 505 осуществляется описание формы многоцветной области посредством использования команд метафайла, соответствующих выбранному формату. Например, для прямоугольной многоцветной области команды метафайла обычно определяют трансформирующую матрицу, размер сохраняемого фрагмента изображения, способ его компрессии, цветовое пространство и т.д. Трансформирующая матрица отражает ряд параметров, влияющих на отображение фрагмента растрового изображения при воспроизведении метафайла. В качестве примера к таким параметрам можно отнести: разрешение визуализации фрагмента изображения (это разрешение может отличаться от разрешений исходного растрового изображения и фрагмента изображения, сохраненного в метафайл); смещение фрагмента изображения относительно координат визуализируемого документа в результате проигрывания метафайла; угол поворота. Для непрямоугольной области команды метафайла также включают в себя последовательность графических команд метафайла, определяющих форму области отсечения. На шаге 506 выполняется компрессия команд метафайла и фрагмента сохраняемого растрового изображения. Компрессия необходима для уменьшения размера результирующего метафайла, но, тем не менее, не является обязательным шагом, и в зависимости от варианта осуществления заявленного способа указанный шаг может быть исключен. Применяемые на шаге 506 способы компрессии (сжатия) данных должны поддерживаться выбранным форматом метафайла. Для компрессии команд метафайла применяются способы сжатия без потери качества, для фрагмента изображения допустимы способы компрессии растровых изображений с потерей качества. Шаг 507 обеспечивает сохранение компрессированных команд метафайла и фрагмента растрового изображения, соответствующего многоцветной области, в метафайл.Scaling is usually performed in the direction of reducing the size of the original image to a predetermined size, preferred for subsequent playback of the metafile. For example, the original bitmap scanned at a resolution of 300 dpi (dots per inch) can be reduced to a resolution of 72 or 96 dpi, corresponding to the resolution of the display. At step 505, the shape of the multi-color region is described by using metafile commands corresponding to the selected format. For example, for a rectangular multicolor region of a metafile command, the transform matrix, the size of the saved fragment of the image, the method of its compression, color space, etc. are usually determined. The transforming matrix reflects a number of parameters that affect the display of a fragment of a raster image when playing a metafile. As an example, these parameters include: resolution of the image fragment rendering (this resolution may differ from the resolutions of the original bitmap image and the image fragment stored in the metafile); displacement of the image fragment relative to the coordinates of the visualized document as a result of playing the metafile; angle of rotation. For a non-rectangular area, metafile commands also include a series of graphical metafile commands that define the shape of the clipping region. At step 506, the metafile commands and the fragment of the saved raster image are compressed. Compression is necessary to reduce the size of the resulting metafile, but, nevertheless, is not a mandatory step, and depending on the implementation of the claimed method, this step may be excluded. The compression methods used in step 506 should be supported by the selected metafile format. For compression of metafile commands, compression methods without loss of quality are used, for a fragment of the image, methods of compression of bitmap images with loss of quality are acceptable. Step 507 stores the compressed metafile instructions and the fragment of the bitmap image corresponding to the multicolor region into the metafile.

Фиг.6 иллюстрирует упрощенную блок-схему сохранения каждой одноцветной области в метафайл. Как упоминалось выше, одноцветные области сохраняются путем описания формы и цвета каждой области набором графических команд метафайла. Такой способ конвертирования растровой области изображения в векторное обеспечивает высокое качество отображения области и независимость от масштаба просмотра. На шаге 601 осуществляется отслеживание каждого контура анализируемой одноцветной области, включая внешний и внутренние контуры. Область может быть ограничена только одним внешним контуром. Внутренних контуров может быть несколько, или они могут отсутствовать. На шаге 602 определяется цвет заполнения одноцветной области. Далее на шаге 603 точки контуров аппроксимируются последовательностями отрезков прямых линий и кривых, поддерживаемых выбранным форматом метафайла. Последовательности аппроксимирующих отрезков и цвет заполнения одноцветной области описываются соответствующими командами метафайла на шаге 604, которые затем компрессируются (шаг 605). Шаг 606 осуществляет сохранение компрессированных команд в метафайл. Область отсечения непрямоугольных многоцветных областей, определяемая на шаге 503, вычисляется подобным образом, за исключением того что аппроксимируется только внешний контур области и отсутствует шаг определения цвета области. Для непрямоугольной многоцветной области аппроксимирующая последовательность обозначается в метафайле как область отсечения.6 illustrates a simplified block diagram of storing each single-color region in a metafile. As mentioned above, monochrome areas are preserved by describing the shape and color of each area with a set of graphical metafile commands. Such a method of converting a raster region of an image into a vector provides high quality display of the region and independence of the viewing scale. At step 601, tracking of each contour of the analyzed one-color region, including external and internal contours, is carried out. An area can be limited to only one external contour. There may be several internal circuits, or they may be absent. At 602, the fill color of the monochrome region is determined. Next, at step 603, the contour points are approximated by sequences of straight line segments and curves supported by the selected metafile format. The sequences of the approximating segments and the fill color of the one-color region are described by the corresponding metafile commands in step 604, which are then compressed (step 605). Step 606 saves the compressed instructions to a metafile. The clipping region of non-rectangular multicolor regions, determined in step 503, is calculated in a similar manner, except that only the outer contour of the region is approximated and there is no step for determining the color of the region. For a non-rectangular multicolor region, the approximating sequence is indicated in the metafile as the clipping region.

Фиг.7 иллюстрирует пример отслеживания (трассировки) контура области. После процедур выявления областей на растровом изображении элементы каждой области отделены от фона и представляют собой связанные группы пикселей (точек). В обычном представлении растровых изображений местоположение пикселей определяется целочисленными координатами и сами пиксели имеют квадратную форму. В предпочтительном варианте осуществления заявленного способа контурная линия определяется как граница между пикселями фона и анализируемой области. В соответствии с иллюстрацией Фиг.7 пиксели области обозначены темно-серыми квадратами 701. Соответственно, контур проходит через точки (вершины), расположенные на углах пикселей и помеченные белыми точками 702. Указанные точки контура имеют так называемые «виртуальные», нецелочисленные координаты. Процедура отслеживания (трассировки) контура начинается из некоторой стартовой точки контура 703 и продолжается вдоль контура в предопределенном направлении до тех пор, пока стартовая точка не встретится снова. Направление отслеживания контура определяется требованиями выбранного формата метафайла, например, для правила ненулевого числа витков (non-zero winding rule) внешний контур отслеживается (трассируется) в направлении движения часовой стрелки, а внутренние контуры - против часовой стрелки или наоборот. Подобное правило обеспечивает корректное заполнение области указанным цветом в ходе проигрывания метафайла.7 illustrates an example of tracking (tracing) the contour of an area. After the procedures for identifying areas in the raster image, the elements of each area are separated from the background and are related groups of pixels (points). In the conventional representation of bitmap images, the location of the pixels is determined by integer coordinates and the pixels themselves are square. In a preferred embodiment of the inventive method, the contour line is defined as the boundary between the pixels of the background and the analyzed area. In accordance with the illustration of Fig. 7, the pixels of the region are indicated by the dark gray squares 701. Accordingly, the contour passes through the points (vertices) located at the corners of the pixels and marked with white dots 702. These contour points have so-called "virtual", non-integer coordinates. The loop tracking (tracing) procedure starts from some starting point of the contour 703 and continues along the contour in a predetermined direction until the starting point meets again. The direction of tracking the contour is determined by the requirements of the selected metafile format, for example, for the non-zero winding rule, the external contour is tracked (traced) in the clockwise direction, and the internal contours are counterclockwise or vice versa. Such a rule ensures the correct filling of the area with the specified color during the playback of the metafile.

После отслеживания контуров одноцветной области выполняется уменьшение количества элементов контуров (упрощение контура) посредством определения их наиболее значимых ключевых точек. Процедура нахождения ключевых точек контура включает в себя два основных шага: на первом шаге определяют сегменты контура, в пределах которых находятся предполагаемые ключевые точки; на втором шаге из возможных комбинаций ключевых точек выбирают такую комбинацию, которая обеспечивает наименьшую ошибку аппроксимации. На Фиг.8 иллюстрируется пример вычисления сегмента контура, в пределах которого находится предполагаемая ключевая точка. Для осуществления этого каждой точке контура ставится в соответствие пара наиболее удаленных точек в соответствии с преопределенным критерием. Например, точке контура 803 соответствует пара наиболее удаленных точек 802 и 806. В предпочтительном варианте осуществления заявляемого способа две точки контура предполагаются наиболее удаленными друг от друга, если участок контура между ними можно аппроксимировать прямой линией, и при этом ошибка аппроксимации не превышает предопределенного значения. Ошибка аппроксимации вычисляется как сумма квадратов расстояний 804 от каждой точки аппроксимируемого участка контура 805 к соответствующей аппроксимирующей линии 801. Множество пар наиболее удаленных точек позволяет определить участки контура, предпочтительные для определения ключевых точек. Например, точка 809 на Фиг.8 является наиболее удаленной для группы точек контура, обозначенных на иллюстрации черными точками 807, соответственно точка 808 является наиболее удаленной для всех точек контура, обозначенных серым цветом 810. Таким образом, точки 808 и 809 для анализируемого фрагмента контура встречаются наибольшее количество раз и, соответственно, определяют границы участка контура 811, предпочтительного для обнаружения ключевой точки.After tracking the contours of a single-color region, the number of contour elements is reduced (contour simplification) by determining their most significant key points. The procedure for finding the key points of the contour includes two main steps: at the first step, determine the segments of the contour, within which the estimated key points are located; in the second step, from the possible combinations of key points, choose a combination that provides the smallest approximation error. FIG. 8 illustrates an example of calculating a contour segment within which an estimated key point is located. To do this, each contour point is associated with a pair of the most distant points in accordance with a predetermined criterion. For example, a contour point 803 corresponds to a pair of the most distant points 802 and 806. In a preferred embodiment of the proposed method, two contour points are assumed to be the most distant from each other if the portion of the contour between them can be approximated by a straight line, and the approximation error does not exceed a predetermined value. The approximation error is calculated as the sum of the squares of the distances 804 from each point of the approximated section of the contour 805 to the corresponding approximating line 801. The set of pairs of the most distant points allows you to determine the sections of the contour that are preferable for determining key points. For example, the point 809 in Fig. 8 is the farthest for the group of contour points indicated by black dots 807 in the illustration, respectively, the point 808 is the farthest for all contour points indicated in gray 810. Thus, the points 808 and 809 for the analyzed fragment of the contour occur the greatest number of times and, accordingly, determine the boundaries of the portion of the contour 811, preferred for the detection of a key point.

На иллюстрации Фиг.9 приведен пример одноцветной области с определенными участками контуров, предпочтительными для обнаружения ключевых точек. Участки отмечены заштрихованными областями 902. В пределах одного участка может быть обнаружена только одна ключевая точка. Далее перечисляются возможные комбинации ключевых точек в пределах соответствующих участков. Среди них выбирается такая комбинация, которой соответствует минимальная ошибка аппроксимации контура отрезками прямых линий. На иллюстрации Фиг.9 показаны результирующие ключевые точки 901. Соответствующая им аппроксимирующая комбинация отрезков прямых, обладающая минимальной ошибкой аппроксимации, показана на Фиг.10.Figure 9 shows an example of a one-color region with certain contour sections preferred for detecting key points. Sites are indicated by shaded areas 902. Only one key point can be detected within a single site. The following are possible combinations of key points within the respective sections. Among them, a combination is selected that corresponds to the minimum error of approximation of the contour by segments of straight lines. The illustration of Fig. 9 shows the resulting key points 901. Their corresponding approximating combination of line segments with a minimum approximation error is shown in Fig. 10.

На основе ключевых точек контура выполняется процедура аппроксимации контура последовательностью отрезков прямых и кривых. Схематически эта процедура иллюстрирована блок-схемой на Фиг.11. Шаг 1101 осуществляет корректировку (уточнение) координат ключевых точек упрощенного контура области. Как показано на Фиг.12, новым ключевым точкам 1201 с уточненными координатами соответствуют новые аппроксимирующие отрезки 1203, обеспечивающие меньшую ошибку аппроксимации контура. При этом корректировка координат ограничена окрестностью исходных ключевых точек 1202. В предпочтительном варианте осуществления заявленного способа указанная окрестность соответствует размеру одного пикселя, т.е. расстояние между уточненным и исходным местоположением ключевой точки не превышает половины пикселя. Шаг 1102 осуществляет аппроксимацию упрощенного контура, определенного уточненными ключевыми точками, отрезками прямых и кривых, соответствующих выбранному формату метафайла. На данном этапе количество используемых элементов векторной графики однозначно определяется количеством ключевых точек. Шаг 1103 выполняет уменьшение количества кривых, участвующих в аппроксимации, что обеспечивает более гладкое отображение контуров в ходе проигрывания метафайла и меньшее количество требуемых графических команд метафайла. На шаге 1104 последовательности отрезков линий и кривых конвертируются (преобразовываются) в описывающие их команды метафайла.Based on the key points of the contour, the procedure of approximating the contour is performed by a sequence of line segments and curves. Schematically, this procedure is illustrated in the flowchart of FIG. 11. Step 1101 performs adjustment (refinement) of the coordinates of the key points of the simplified contour of the area. As shown in FIG. 12, new approximate segments 1203 correspond to new key points 1201 with refined coordinates, providing a smaller error in the approximation of the contour. Moreover, the coordinate adjustment is limited to the vicinity of the source key points 1202. In a preferred embodiment of the claimed method, said neighborhood corresponds to the size of one pixel, i.e. the distance between the specified and the original location of the key point does not exceed half a pixel. Step 1102 approximates a simplified outline defined by refined key points, line segments, and curves corresponding to the selected metafile format. At this stage, the number of vector graphics elements used is uniquely determined by the number of key points. Step 1103 performs a reduction in the number of curves involved in the approximation, which provides a smoother display of the contours during playback of the metafile and a smaller number of required graphic metafile commands. At 1104, sequences of line segments and curves are converted (converted) into metafile instructions describing them.

В предпочтительном варианте осуществления заявляемого способа аппроксимация контуров области выполняется с помощью двух графических функций, поддерживаемых большинством существующих форматов метафайлов: отрезка прямой линии и кривой Безье третьего порядка. Команда отображения отрезка прямой линии обычно сопровождается аргументами, определяющими начало и конец отрезка. Соответственно команда визуализации кривой Безье третьего порядка включает в себя аргументы, определяющие начало, конец кривой и две контрольные точки, регулирующие изгиб и форму кривой.In a preferred embodiment of the proposed method, the approximation of the contours of the region is performed using two graphical functions supported by most existing metafile formats: a straight line segment and a third-order Bezier curve. The command to display a straight line segment is usually accompanied by arguments defining the beginning and end of the line segment. Accordingly, the third-order Bezier curve visualization command includes arguments defining the beginning, end of the curve, and two control points that control the bending and shape of the curve.

Кривые Безье используются для описания участков контура, образуемых пересечением двух аппроксимирующих отрезков в ключевой точке контура. Таким образом, при расчете параметров кривой анализируется треугольник, одной из вершин которого является ключевой точкой, а примыкающие к ней грани - аппроксимирующими отрезками. В соответствии с иллюстрацией Фиг.13 для упрощения расчета параметров кривой Безье предполагается, что контрольные точки 1302 кривой располагаются на гранях анализируемого треугольника, примыкающих к вершине 1301. В этом случае контрольные точки кривой определяются двумя параметрами α и β, изменения которых в диапазоне от 0 до 1 иллюстрированы несколькими примерами на Фиг.13. В общем случае значения указанных параметров могут превышать единицу.Bezier curves are used to describe the contour sections formed by the intersection of two approximating segments at the key point of the contour. Thus, when calculating the parameters of the curve, a triangle is analyzed, one of the vertices of which is the key point, and the edges adjacent to it are approximated segments. In accordance with the illustration of FIG. 13, to simplify the calculation of the parameters of the Bezier curve, it is assumed that the control points 1302 of the curve are located on the faces of the analyzed triangle adjacent to the vertex 1301. In this case, the control points of the curve are determined by two parameters α and β, whose changes in the range from 0 to 1 are illustrated by several examples in FIG. 13. In the general case, the values of the indicated parameters may exceed unity.

Фиг.14 и Фиг.15 иллюстрируют этапы вычисления контрольных точек кривой Безье. В качестве первого шага вычисляются средние точки 1401 и 1407 соответствующих аппроксимирующих отрезков упрощенного контура, пересекающихся в анализируемой ключевой точке 1403 контура. Далее определяется прямая 1408, проходящая через указанные средние точки. На следующем шаге выполняется параллельный перенос полученной прямой до момента ее пересечения в точке 1409 с окрестностью ключевой точки. Окрестность ключевой точки ограничена окружностью 1404 преопределенного радиуса. В предпочтительном варианте значение радиуса соответствует длине стороны пикселя растрового изображения, умноженной на коэффициент

Figure 00000001
. Полученная путем параллельного переноса прямая 1406 пересекается с аппроксимирующими отрезками в точках 1402 и 1405, определяющих контрольные точки кривой Безье α и β соответственно. Значения α и β с точностью до пропорционального коэффициента равняются нормированным длинам отрезков, отсекаемых параллельными прямыми. На примере, приведенном на Фиг.14, параметр α равен отношению длины отрезка, ограниченного точками 1401 и 1402, к длине отрезка 1401-1403, умноженному на пропорциональный коэффициент. Предпочтительное значение пропорционального коэффициента равняется 4/3, в этом случае кривая Безье проходит через точку пересечения с окрестностью ключевой точки (1409, 1507). На Фиг.15 приводится кривая Безье, соответствующая вычисленным параметрам. Аппроксимирующая кривая 1505 Безье соединяет средние точки 1501 и 1506. Контрольные точки 1502, 1504 кривой вычислены в соответствии с приведенным выше описанием.Fig and Fig illustrate the steps of calculating the control points of the Bezier curve. As a first step, the midpoints 1401 and 1407 of the corresponding approximating segments of the simplified contour intersecting at the analyzed key point 1403 of the contour are calculated. Next, line 1408 passes through the indicated midpoints. At the next step, the resulting line is parallel transferred until it intersects at point 1409 with the vicinity of the key point. The neighborhood of the key point is bounded by a circle 1404 of a predetermined radius. In a preferred embodiment, the radius value corresponds to the length of the pixel side of the bitmap multiplied by the coefficient
Figure 00000001
. The straight line 1406 obtained by parallel transfer intersects the approximating segments at points 1402 and 1405 that define the control points of the Bezier curve α and β, respectively. The values of α and β are accurate to a proportional coefficient equal to the normalized lengths of segments cut off by parallel lines. In the example shown in Fig. 14, the parameter α is equal to the ratio of the length of the segment bounded by points 1401 and 1402 to the length of the segment 1401-1403 times the proportional coefficient. The preferred value of the proportional coefficient is 4/3, in which case the Bezier curve passes through the intersection point with the vicinity of the key point (1409, 1507). On Fig shows the Bezier curve corresponding to the calculated parameters. An approximating Bezier curve 1505 connects the midpoints 1501 and 1506. The control points 1502, 1504 of the curve are calculated in accordance with the above description.

После вычисления параметров кривой Безье выполняется проверка соответствия ее контрольных точек ряду условий. Для этого вычисляется параметр

Figure 00000002
. В случае если параметр γ удовлетворяет диапазону допустимых значений 0,55<γ≤1, параметры α и β остаются без изменений. При выполнении условия γ≤0,55, контрольные точки кривой Безье заменяются значениями, соответствующими α=β=0,55. Если выполняется условие γ>1, тогда принимается решение о замене аппроксимирующей кривой двумя отрезками прямых, ограниченных соответствующей средней точкой и примыкающих одна к другой в анализируемой ключевой точке. Например, выполнение условия γ>1 для Фиг.15 приведет к тому, что кривая Безье будет заменена двумя отрезками. Первый отрезок ограничен точками 1501 и 1503, второй отрезок ограничен точками 1503 и 1506.After calculating the parameters of the Bezier curve, it checks whether its control points correspond to a number of conditions. For this, the parameter is calculated
Figure 00000002
. If the parameter γ satisfies the range of admissible values of 0.55 <γ≤1, the parameters α and β remain unchanged. When the condition γ≤0.55 is fulfilled, the control points of the Bezier curve are replaced by values corresponding to α = β = 0.55. If the condition γ> 1 is satisfied, then a decision is made to replace the approximating curve by two segments of lines bounded by the corresponding midpoint and adjacent to one another at the analyzed key point. For example, the fulfillment of the condition γ> 1 for Fig. 15 will cause the Bezier curve to be replaced by two segments. The first segment is limited by points 1501 and 1503, the second segment is limited by points 1503 and 1506.

На Фиг.16 иллюстрируется пример аппроксимации контуров одноцветной области в соответствии с заявляемым способом.On Fig illustrates an example of approximation of the contours of a single-color region in accordance with the claimed method.

Фиг.17 иллюстрирует примеры увеличенных исходных растровых одноцветных областей и результат их отображения после аппроксимации. Следует отметить, что поскольку предлагаемая аппроксимация соответствует векторному описанию формы областей, следовательно, их отображение не зависит от масштаба просмотра.17 illustrates examples of enlarged original raster monochrome areas and the result of their display after approximation. It should be noted that since the proposed approximation corresponds to the vector description of the shape of the regions, therefore, their display does not depend on the viewing scale.

Заявляемый способ предназначен для реализации программно-аппаратными средствами в составе черно-белых и цветных многофункциональных печатающих устройств и цифровых копиров. Также способ может быть реализован в составе программного обеспечения сканирующих устройств.The inventive method is intended for implementation by software and hardware in black and white and color multifunction printing devices and digital copiers. Also, the method can be implemented as part of the software scanning devices.

Claims (7)

1. Способ преобразования растрового изображения в метафайл, включающий в себя выполнение следующих операций:
- выявляют на растровом изображении области фона;
- определяют тип фона;
- сохраняют в метафайл команды, касающиеся отображения фона;
- выявляют на растровом изображении многоцветные области;
- сохраняют многоцветные области в метафайл как команды, касающиеся отображения фрагментов растрового изображения;
- выявляют на растровом изображении одноцветные области;
- сохраняют в метафайл команды, касающиеся отображения одноцветных областей.
1. A method of converting a raster image to a metafile, including the following operations:
- reveal the background area on the raster image;
- determine the type of background;
- save the commands related to the background display in the metafile;
- multicolor areas are detected on the raster image;
- save multi-color areas in the metafile as commands relating to the display of fragments of the bitmap image;
- single-color areas are detected on the raster image;
- save the commands related to the display of monochrome areas into the metafile.
2. Способ по п.1, отличающийся тем, что определяют тип фона на растровом изображении в соответствии со следующими предопределенными категориями: одноцветный фон, градиентный фон, многоцветный фон.2. The method according to claim 1, characterized in that the type of background on the bitmap image is determined in accordance with the following predefined categories: single-color background, gradient background, multi-color background. 3. Способ по п.1, отличающийся тем, что сохраняют в метафайл команды для отображения фона в соответствии с определенным ранее типом фона:
- одноцветный фон описывают как прямоугольник, закрашенный указанным цветом;
- градиентный фон описывают записями в метафайле, определяющими направление и тип градиентного изменения цвета;
- многоцветный фон сохраняют в метафайл как растровое изображение.
3. The method according to claim 1, characterized in that the instructions for displaying the background are stored in the metafile in accordance with the background type previously defined:
- one-color background is described as a rectangle filled with the specified color;
- gradient background is described by records in the metafile that determine the direction and type of gradient color change;
- the multicolor background is saved to the metafile as a bitmap image.
4. Способ по п.1, отличающийся тем, что в ходе определения типа фона, в зависимости от предварительных настроек, фон может быть заменен на полностью или частично прозрачный.4. The method according to claim 1, characterized in that during the determination of the type of background, depending on the preset settings, the background can be replaced with fully or partially transparent. 5. Способ по п.1, отличающийся тем, что сохраняют многоцветные области в метафайл посредством выполнения следующих операций для каждой многоцветной области:
- определяют ограничивающий прямоугольник, описывающий многоцветную область, причем допускается, чтобы стороны ограничивающего прямоугольника были наклонены к сторонам исходного растрового изображения;
- определяют форму многоцветной области как прямоугольную или непрямоугольную;
- определяют область отсечения для непрямоугольной многоцветной области;
- масштабируют фрагмент растрового изображения, соответствующий многоцветной области, к предопределенному разрешению;
- описывают форму многоцветной области посредством соответствующих команд метафайла;
- компрессируют команды метафайла и фрагмент растрового изображения, соответствующий многоцветной области;
- сохраняют компрессированные команды в метафайл.
5. The method according to claim 1, characterized in that the multi-color areas are saved in a metafile by performing the following operations for each multi-color area:
- define the bounding box that describes the multicolor region, and it is allowed that the sides of the bounding box were tilted to the sides of the original bitmap;
- determine the shape of the multicolor region as rectangular or non-rectangular;
- determine the clipping region for a non-rectangular multicolor region;
- scale the fragment of the raster image corresponding to the multicolor region, to a predetermined resolution;
- describe the shape of the multicolor region by means of the corresponding metafile commands;
- compress the metafile commands and the bitmap fragment corresponding to the multicolor region;
- save compressed commands to a metafile.
6. Способ по п.1, отличающийся тем, что сохраняют одноцветные области в метафайл посредством выполнения для каждой одноцветной области следующих операций:
- отслеживают точки внешнего и внутренних контуров одноцветной области;
- оценивают цвет одноцветной области;
- аппроксимируют точки внешнего и внутренних контуров последовательностями отрезков прямых и кривых;
- формируют последовательность команд метафайла, описывающих аппроксимирующую последовательность и цвет одноцветной области;
- компрессируют последовательность команд метафайла;
- сохраняют компрессированные команды в метафайл.
6. The method according to claim 1, characterized in that the one-color areas are saved in a metafile by performing the following operations for each one-color area:
- track the points of the external and internal contours of the same-color region;
- evaluate the color of the monochrome area;
- approximate the points of the external and internal contours by sequences of line segments and curves;
- form a sequence of metafile commands describing the approximating sequence and color of a single-color region;
- compress the sequence of metafile commands;
- save compressed commands to a metafile.
7. Способ по п.1, отличающийся тем, что при сохранении многоцветных областей в метафайл определяют область отсечения для непрямоугольной многоцветной области путем выполнения следующих этапов:
- отслеживают точки внешнего контура непрямоугольной многоцветной области;
- аппроксимируют точки внешнего контура последовательностью отрезков прямых и кривых;
- составляют последовательность команд метафайла, описывающих аппроксимирующую последовательность и определяющих ее как область отсечения для многоцветной области;
- компрессируют последовательность команд метафайла;
- сохраняют компрессированные команды в метафайл.
7. The method according to claim 1, characterized in that when saving the multi-color areas in the metafile, the clipping region for the non-rectangular multi-color area is determined by performing the following steps:
- track the points of the outer contour of a non-rectangular multicolor region;
- approximate the points of the outer contour by a sequence of line segments and curves;
- make up a sequence of metafile commands describing the approximating sequence and defining it as a clipping region for a multicolor region;
- compress the sequence of metafile commands;
- save compressed commands to a metafile.
RU2011146617/08A 2011-11-17 2011-11-17 Method to convert bitmapped image into metafile RU2469400C1 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
RU2011146617/08A RU2469400C1 (en) 2011-11-17 2011-11-17 Method to convert bitmapped image into metafile
KR1020120035063A KR101869302B1 (en) 2011-11-17 2012-04-04 Raster image conversion apparatus, image scanning apparatus, method for conversion of raster image, and computer-readable recording medium
US13/670,973 US20130128324A1 (en) 2011-11-17 2012-11-07 Raster image conversion apparatus, image scanning apparatus, method of converting raster image, and computer-readable recording medium
EP12193139.8A EP2597616A3 (en) 2011-11-17 2012-11-19 Raster image conversion apparatus, image scanning apparatus, method of converting raster image, and computer-readable recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
RU2011146617/08A RU2469400C1 (en) 2011-11-17 2011-11-17 Method to convert bitmapped image into metafile

Publications (1)

Publication Number Publication Date
RU2469400C1 true RU2469400C1 (en) 2012-12-10

Family

ID=48663595

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2011146617/08A RU2469400C1 (en) 2011-11-17 2011-11-17 Method to convert bitmapped image into metafile

Country Status (2)

Country Link
KR (1) KR101869302B1 (en)
RU (1) RU2469400C1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2534005C2 (en) * 2013-02-01 2014-11-27 Корпорация "САМСУНГ ЭЛЕКТРОНИКС Ко., Лтд." Method and system for converting screenshot into metafile
RU2637901C2 (en) * 2015-11-06 2017-12-07 Общество С Ограниченной Ответственностью "Яндекс" Method and data storing computer device for drawing graphic objects
RU2637903C2 (en) * 2015-09-29 2017-12-07 Общество С Ограниченной Ответственностью "Яндекс" Method and computer device for creating simplified borders of graphic objects
RU2643431C2 (en) * 2015-09-02 2018-02-01 Общество С Ограниченной Ответственностью "Яндекс" Method and server of curve simplification

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180067221A (en) * 2016-12-12 2018-06-20 에이치피프린팅코리아 주식회사 Host divice transmitting print data to printer and method for encoding print data by host device
KR20240012673A (en) 2022-07-21 2024-01-30 (주)인텔리코리아 System and method for converting raster images of traditional wooden buildings into cad electronic drawings
KR102481005B1 (en) 2022-07-27 2022-12-26 주식회사 이안 System for creating electronic piping drawings using parer piping drawings

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2176823C2 (en) * 1995-11-29 2001-12-10 Грэфик Секьюрити Системз Корпорейшн Program-implemented method and device for counterfeiting protection
US7289122B1 (en) * 2004-12-22 2007-10-30 Sun Microsystems, Inc. Method and apparatus for approximating an arbitrary shape with a closed Bezier curve
US20110007334A1 (en) * 2009-07-07 2011-01-13 Xerox Corporation Between-segment discontinuity reduction for text vectorization using dominant point classification

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4371911B2 (en) * 2004-05-31 2009-11-25 キヤノン株式会社 Functionalization processing method and functionalization processing apparatus
US7283674B2 (en) * 2004-06-25 2007-10-16 Xerox Corporation Using graphic objects in MFD scan-to-export function
JP4236659B2 (en) * 2005-11-02 2009-03-11 シャープ株式会社 Image encoding apparatus, image encoding method, image encoding program, and recording medium
JP4582200B2 (en) * 2008-06-03 2010-11-17 コニカミノルタビジネステクノロジーズ株式会社 Image processing apparatus, image conversion method, and computer program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2176823C2 (en) * 1995-11-29 2001-12-10 Грэфик Секьюрити Системз Корпорейшн Program-implemented method and device for counterfeiting protection
US7289122B1 (en) * 2004-12-22 2007-10-30 Sun Microsystems, Inc. Method and apparatus for approximating an arbitrary shape with a closed Bezier curve
US20110007334A1 (en) * 2009-07-07 2011-01-13 Xerox Corporation Between-segment discontinuity reduction for text vectorization using dominant point classification

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2534005C2 (en) * 2013-02-01 2014-11-27 Корпорация "САМСУНГ ЭЛЕКТРОНИКС Ко., Лтд." Method and system for converting screenshot into metafile
RU2643431C2 (en) * 2015-09-02 2018-02-01 Общество С Ограниченной Ответственностью "Яндекс" Method and server of curve simplification
RU2637903C2 (en) * 2015-09-29 2017-12-07 Общество С Ограниченной Ответственностью "Яндекс" Method and computer device for creating simplified borders of graphic objects
RU2637901C2 (en) * 2015-11-06 2017-12-07 Общество С Ограниченной Ответственностью "Яндекс" Method and data storing computer device for drawing graphic objects

Also Published As

Publication number Publication date
KR101869302B1 (en) 2018-06-20
KR20130054899A (en) 2013-05-27

Similar Documents

Publication Publication Date Title
RU2469400C1 (en) Method to convert bitmapped image into metafile
US8471855B2 (en) Graphics-rendering apparatus
EP2549735A2 (en) Method of editing static digital combined images comprising images of multiple objects
US20110113323A1 (en) Systems and methods to resize document content
CN110140151B (en) Apparatus and method for generating light intensity image
US8212815B2 (en) Drawing apparatus, drawing program, and drawing method
JP5939154B2 (en) Image processing apparatus and computer program
US20060244751A1 (en) Image processing apparatus and its control method, and program
US6421063B1 (en) Pixel zoom system and method for a computer graphics system
JP4983684B2 (en) Image processing apparatus, image processing method, and computer program for image processing
US20090303550A1 (en) Image processing apparatus and image processing method
US20100283780A1 (en) Information processing apparatus, information processing method, and storage medium
JP5042917B2 (en) Image processing apparatus and program
EP2536123B1 (en) Image processing method and image processing apparatus
US9384562B2 (en) Methods for visual content processing, and systems and computer program codes thereto
JP6294700B2 (en) Image processing apparatus and image processing method
KR101887929B1 (en) Image Processing Apparatus, Image Processing Method, Computer Readable Recording Medium and Image Forming Apparatus
JP2004199622A (en) Apparatus and method for image processing, recording media, and program
JP5888989B2 (en) Image processing apparatus and image processing method
JP2012118792A (en) Electronic document production system, electronic document production method and program
US20060119897A1 (en) Output apparatus and program thereof
EP2597616A2 (en) Raster image conversion apparatus, image scanning apparatus, method of converting raster image, and computer-readable recording medium
US7127118B2 (en) System and method for compressing image files while preserving visually significant aspects
JP2004215163A (en) Image interpolation system, image interpolation method, and image interpolation program
JP5151946B2 (en) Drawing device

Legal Events

Date Code Title Description
PD4A Correction of name of patent owner
PC41 Official registration of the transfer of exclusive right

Effective date: 20170921

PD4A Correction of name of patent owner
MM4A The patent is invalid due to non-payment of fees

Effective date: 20191118