RU2469399C1 - System and method of draft mode printing by means of conversion of pictures into contour sketches - Google Patents

System and method of draft mode printing by means of conversion of pictures into contour sketches Download PDF

Info

Publication number
RU2469399C1
RU2469399C1 RU2011138830/08A RU2011138830A RU2469399C1 RU 2469399 C1 RU2469399 C1 RU 2469399C1 RU 2011138830/08 A RU2011138830/08 A RU 2011138830/08A RU 2011138830 A RU2011138830 A RU 2011138830A RU 2469399 C1 RU2469399 C1 RU 2469399C1
Authority
RU
Russia
Prior art keywords
graphic primitives
contour
pictures
sketches
primitives
Prior art date
Application number
RU2011138830/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 RU2011138830/08A priority Critical patent/RU2469399C1/en
Priority to EP12185521.7A priority patent/EP2574033B1/en
Priority to KR1020120104948A priority patent/KR101899033B1/en
Priority to US13/623,985 priority patent/US9036203B2/en
Application granted granted Critical
Publication of RU2469399C1 publication Critical patent/RU2469399C1/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/387Composing, repositioning or otherwise geometrically modifying originals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K15/00Arrangements for producing a permanent visual presentation of the output data, e.g. computer output printers
    • G06K15/02Arrangements for producing a permanent visual presentation of the output data, e.g. computer output printers using printers
    • G06K15/18Conditioning data for presenting it to the physical printing elements
    • G06K15/1848Generation of the printable image
    • G06K15/1849Generation of the printable image using an intermediate representation, e.g. a list of graphical primitives

Abstract

FIELD: printing industry.
SUBSTANCE: method of draft mode printing is carried out by means of conversion of pictures into contour sketches. At first graphic primitives are extracted from a flow of printed data or a printing task. Then the above graphic primitives are combined into pictures in accordance with their geometrical proximity. Then the produced pictures are converted into contour sketches. Afterwards a flow of printed data or a printing task is modified by replacement of a part of graphic primitives with produced contour sketches. Further the modified data flow or printing task is printed.
EFFECT: saving ink, toner of a printing device without loss of recognisability of printed images.
8 cl, 14 dwg

Description

Изобретение относится к области цифровой печати, а более конкретно к ресурсосберегающим технологиям в цифровой печати, в частности к системам и способам экономичной черновой печати, нацеленным на сбережение краски (или тонера) печатающего устройства.The invention relates to the field of digital printing, and more particularly to resource-saving technologies in digital printing, in particular to systems and methods for cost-effective draft printing aimed at saving ink (or toner) of a printing device.

Современные печатающие устройства и драйверы печати имеют так называемый режим черновой печати. Этот режим предполагает снижение качества печати текста и изображений с целью экономии печатающей краски (тонера). При этом для этой цели используют различные преобразования данных, посылаемых на печатающее устройство.Modern printers and print drivers have the so-called draft mode. This mode involves reducing the print quality of text and images in order to save printing ink (toner). At the same time, various transformations of the data sent to the printing device are used for this purpose.

Данные, выводимые на печатающее устройство, могут быть представлены либо в форме метафайла, либо в формате языка описания страниц (PDL). Конкретными примером метафайла является EMF компании Microsoft, примерами языка описания страниц - Postscript и PCL. Формат PDF, изначально предназначавшийся для описания страниц, в настоящее время также используется как метафайл в ряде операционных систем.Data output to a printing device may be presented either in the form of a metafile or in the format of a page description language (PDL). A specific example of a metafile is Microsoft EMF, examples of page description language are Postscript and PCL. The PDF format, originally intended to describe pages, is now also used as a metafile on a number of operating systems.

Любой из вышеназванных форматов подразумевает, что данные группируются в раздельные записи (именуемые также «командами» или «тегами»), специфичные для текста, растровых изображений и векторной графики. В конечном итоге все эти данные растеризуются и печатаются. Поэтому существует возможность добиться желаемых изменений в печатаемой странице путем внесения изменений в записи метафайла или языка описания страниц. Такой подход позволяет управлять процессом печати, в частности в режиме черновой печати.Any of the above formats implies that the data is grouped into separate records (also referred to as “commands” or “tags”) specific to text, bitmap images and vector graphics. Ultimately, all this data is rasterized and printed. Therefore, it is possible to achieve the desired changes in the printed page by making changes to the metafile or page description language entries. This approach allows you to control the printing process, in particular in draft mode.

Из уровня техники известно применение подхода, основанного на избирательной предобработке данных в соответствии с их типом. Так, например, раздельные способы обработки для различных типов записей в потоке печатаемых данных предлагаются в заявке на изобретение США №20100214614 [1]. Аналогичный подход описан в заявках США №20100128287 [2], 20050063749 [3], 20090290883 [4]. Следует упомянуть также подход, описанный в заявке на изобретение США №20090195811 [5], в которой предлагается исключать из процесса печати предварительно распознанные данные определенных типов. Наиболее близким к заявляемому изобретению является подход, описанный в патенте США №6761422 [6], где предлагается предварительное разделение печатаемых данных на типовые объекты с назначением специфичных правил растеризации и печати для разных типов объектов.It is known from the prior art to apply an approach based on the selective preprocessing of data according to their type. So, for example, separate processing methods for various types of records in the stream of printed data are proposed in the application for US invention No. 20100214614 [1]. A similar approach is described in US applications No. 20100128287 [2], 20050063749 [3], 20090290883 [4]. It should also be mentioned the approach described in application for US invention No. 20090195811 [5], in which it is proposed to exclude from the printing process previously recognized data of certain types. Closest to the claimed invention is the approach described in US patent No. 6761422 [6], which proposes a preliminary separation of the printed data into typical objects with the appointment of specific rules for rasterization and printing for different types of objects.

Всем известным решениям присущи серьезные недостатки. В частности, как правило, все методы черновой печати базируются на уменьшении плотности закраски изображения, что неизбежно ведет к ухудшению визуального качества. В то же время экономия печатной краски (тонера) при таком подходе невелика, поскольку по-прежнему закрашиваются участки площади рисунка, а не линии.Serious flaws are inherent in all known solutions. In particular, as a rule, all methods of draft printing are based on a decrease in the density of shading of the image, which inevitably leads to a deterioration in visual quality. At the same time, the saving of printing ink (toner) with this approach is small, since the areas of the drawing area, rather than the lines, are still painted over.

Дополнительные проблемы возникают в связи с тем, что данные, визуально выглядящие как «картинки», могут быть представлены не только как цельные растровые изображения, но и как набор отдельных графических элементов, в частности, как векторная графика. Поскольку в этом случае картинка представляет собой набор разрозненных элементов, эти данные невозможно непосредственно обработать как единое целое, как единую «картинку». В этом случае предписываемые различными методами индивидуальные правила экономичной печати изображений, предлагаемые в вышеперечисленных заявках, бесполезны, так как применимы к целому изображению, а не к отдельным элементам (линиям, элементарным формам).Additional problems arise due to the fact that data that visually looks like “pictures” can be represented not only as whole raster images, but also as a set of separate graphic elements, in particular, as vector graphics. Since in this case the picture is a set of disparate elements, this data cannot be directly processed as a whole, as a single "picture". In this case, the individual rules prescribed by various methods for economical printing of images, proposed in the above applications, are useless, as they apply to the whole image, and not to individual elements (lines, elementary forms).

Более того, для составной (в частности, векторной) графики проблемы возникают не только при попытках применить индивидуальные правила печати изображений, но и при трансформации такой составной графики в контурный эскиз. Отдельные графические примитивы могут быть «слишком элементарны» для такого преобразования. В самом деле такое преобразование не применимо, например, к примитиву, представляющему собой маленькое растровое изображение - полосу шириной в один пиксель. Преобразование может быть применено только ко всей картинке в целом. В таких ситуациях разрозненные графические элементы следует предварительно группировать в картинки, а затем применять к этим картинкам преобразование их в контурные эскизы.Moreover, for composite (in particular, vector) graphics, problems arise not only when trying to apply individual rules for printing images, but also when transforming such composite graphics into a contour sketch. Individual graphic primitives may be “too elementary” for such a transformation. In fact, such a conversion is not applicable, for example, to a primitive that is a small bitmap image - a strip with a width of one pixel. The conversion can only be applied to the whole picture as a whole. In such situations, disparate graphic elements should first be grouped into pictures, and then they should be converted to outline sketches for these pictures.

Задача, на решение которой направлено заявляемое изобретение, заключается в разработке такого способа, который позволил бы добиться существенной экономии расходных материалов при черновой печати, а именно, экономии печатной краски/тонера без утраты узнаваемости напечатанных картинок, а также системы, реализующей этот способ.The problem to which the claimed invention is directed is to develop such a method that would allow to achieve significant savings in consumables for draft printing, namely, saving printing ink / toner without losing recognition of the printed pictures, as well as a system that implements this method.

Технический результат достигается за счет применения заявляемого способа, основанного на преобразовании печатаемых картинок в контурные эскизы («скетчи»). При этом способ черновой печати посредством преобразования картинок в контурные эскизы заключается в выполнении следующих операций:The technical result is achieved through the application of the proposed method, based on the conversion of printed pictures into contour sketches (“sketches”). In this case, the method of draft printing by converting images to contour sketches consists in the following operations:

- извлекают графические примитивы из потока печатаемых данных или из задания на печать;- extract graphic primitives from the stream of printed data or from a print job;

- объединяют вышеуказанные графические примитивы в картинки в соответствии с их геометрической близостью;- combine the above graphic primitives into pictures in accordance with their geometric proximity;

- преобразуют полученные картинки в контурные эскизы;- convert the resulting pictures into contour sketches;

- модифицируют поток печатаемых данных или задание на печать путем замены, по меньшей мере, части графических примитивов на полученные контурные эскизы;- modify the flow of printed data or the print job by replacing at least part of the graphic primitives with the resulting outline sketches;

- печатают модифицированный поток данных или задание на печать.- print a modified data stream or print job.

Что касается системы, реализующей заявляемый способ черновой печати посредством преобразования картинок в контурные эскизы, то такая система отличается тем, что содержит:As for the system that implements the inventive method of draft printing by converting pictures into contour sketches, such a system is characterized in that it contains:

- модуль анализа записей потока печатаемых данных или задания на печать, выполненный с возможностью осуществления анализа таких записей путем разделения их на графические примитивы и прочие записи, с последующей передачей выделенных графических примитивов в модуль объединения графических примитивов и в модуль итоговой сборки, причем прочие записи передаются только в модуль итоговой сборки;- a module for analyzing records of a stream of printed data or a print job, configured to analyze such records by dividing them into graphic primitives and other records, followed by transferring the selected graphic primitives to the module for combining graphic primitives and to the final assembly module, and other records are transmitted only in the final assembly module;

- модуль объединения графических примитивов, выполненный с возможностью приема вышеуказанных графических примитивов, объединения их в картинки в соответствии с их геометрической близостью и передачи полученных картинок в виде групп графических примитивов в модуль преобразования картинок в контурные эскизы;- a module for combining graphic primitives, configured to receive the above graphic primitives, combining them into pictures in accordance with their geometric proximity and transferring the resulting pictures as groups of graphic primitives to a module for converting pictures into contour sketches;

- модуль преобразования картинок в контурные эскизы, выполненный с возможностью приема картинок, представленных группами объединенных графических примитивов, преобразования их в контурные эскизы путем выделения в них контуров и передачи полученных контурных эскизов в модуль итоговой сборки;- a module for converting pictures into contour sketches, configured to receive pictures represented by groups of combined graphic primitives, converting them into contour sketches by selecting contours in them and transferring the resulting contour sketches to the final assembly module;

- модуль итоговой сборки задания на печать, выполненный с возможностью приема эскизов из модуля преобразования картинок в контурные эскизы, и приема из модуля анализа записей всех прочих записей исходного задания, а также формирования модифицированного задания на печать путем замены, по меньшей мере, части графических примитивов на полученные контурные эскизы с последующей передачей модифицированного задания в модуль растеризации и печати;- a module for the final assembly of a print job, configured to receive sketches from the module for converting pictures to contour sketches, and receive from the analysis module records of all other records of the original job, as well as the formation of a modified print job by replacing at least some of the graphic primitives on the received outline sketches with the subsequent transfer of the modified task to the rasterization and printing module;

- модуль растеризации и печати, выполненный с возможностью приема модифицированного задания на печать, его растеризации и распечатки.- a rasterization and printing module, configured to receive a modified print job, rasterize and print it.

Здесь и далее термин «контурный эскиз» («скетч») используется для обозначения изображения, выглядящего как карандашный рисунок контуров, выделенных в исходной картинке (см. Фиг.1, на которой показан пример исходной картинки и полученного из нее контурного эскиза).Hereinafter, the term “outline sketch” (“sketch”) is used to refer to an image that looks like a pencil drawing of the contours highlighted in the original image (see Figure 1, which shows an example of the original image and the outline sketch obtained from it).

Существо заявляемого изобретения поясняется далее с привлечением графических материалов.The essence of the claimed invention is explained below with the involvement of graphic materials.

Фиг.1. Илюстрация к получению контурного эскиза.Figure 1. Illustration for a contour sketch.

1.1 - исходное изображение.1.1 is the original image.

1.2 - контурный эскиз, полученный из исходного изображения (выглядит как карандашный эскиз исходного изображения).1.2 - a contour sketch obtained from the original image (looks like a pencil sketch of the original image).

Фиг.2. Блок-схема предпочтительной реализации заявляемого способа.Figure 2. The block diagram of the preferred implementation of the proposed method.

Фиг.3. Модификация задания на печать, представленного в виде метафайла для одной распечатываемой страницы.Figure 3. Modification of a print job presented as a metafile for one printed page.

Фиг.4. Иллюстрация факта невозможности автономного построения контурных эскизов для отдельно взятых графических примитивов без учета всей картинки в целом. Пример: картинка, состоящая из цветных прямоугольников без явно выделенных границ.Figure 4. Illustration of the impossibility of autonomous construction of contour sketches for individual graphic primitives without taking into account the whole picture as a whole. Example: a picture consisting of colored rectangles without clearly marked borders.

Фиг.5. Иллюстрация факта невозможности автономного построения контурных эскизов для отдельно взятых графических примитивов без учета всей картинки в целом. Пример: картинка, состоящая из растровых изображений, представляющих собой одиночные ряды пикселей.Figure 5. Illustration of the impossibility of autonomous construction of contour sketches for individual graphic primitives without taking into account the whole picture as a whole. Example: a picture consisting of raster images representing single rows of pixels.

Фиг.6. Определение картинки в соответствии с восприятием человеческого зрения.6. Definition of a picture in accordance with the perception of human vision.

6.1 - человеческий глаз различает на показанной странице четыре раздельных картинки, несмотря на то, что некоторые из них состоят из нескольких графических примитивов.6.1 - the human eye distinguishes four separate pictures on the page shown, despite the fact that some of them consist of several graphic primitives.

6.2 - несколько отдельно расположенных графических примитивов воспринимаются человеческим глазом как целая картинка.6.2 - several separately located graphic primitives are perceived by the human eye as a whole picture.

Фиг.7. Описанный прямоугольник как пример границы локализации для графических примитивов.7. The described rectangle as an example of the localization boundary for graphic primitives.

Фиг.8. Графические примитивы объединяются, если их зоны локализации (описанные прямоугольники) перекрываются.Fig. 8. Graphic primitives are combined if their localization zones (the described rectangles) overlap.

Фиг.9. Графические примитивы объединяются, если их зоны локализации (описанные прямоугольники) расположены «достаточно близко» - в пределах предписанных допустимых расстояний. С учетом допуска графические примитивы могут быть объединены даже в случае, если они не имеют строгого перекрытия.Fig.9. Graphic primitives are combined if their localization zones (the described rectangles) are located “close enough” - within the prescribed permissible distances. Subject to tolerance, graphic primitives can be combined even if they do not have a strict overlap.

Фиг.10. Одна итерация группирования графических примитивов. Эта процедура является составной частью процесса, компонующего графические примитивы в картинки.Figure 10. One iteration of grouping graphic primitives. This procedure is an integral part of the process that composes graphic primitives into pictures.

Фиг.11. Иллюстрация к итерациям группирования графических примитивов.11. Illustration for iterations of grouping graphic primitives.

11.1 - две группы объединенных графических примитивов окружены описанными прямоугольниками;11.1 - two groups of combined graphic primitives are surrounded by the described rectangles;

11.2 - две вышеназванные группы рассматриваются как новые графические примитивы и объединяются в еще большую группу.11.2 - the two groups mentioned above are considered as new graphic primitives and are combined into an even larger group.

Фиг.12. Процесс объединения графических примитивов в картинки.Fig. 12. The process of combining graphic primitives into pictures.

Фиг.13. Иллюстрация к процессу объединения графических примитивов: одна итерация уменьшает количество вновь получаемых графических примитивов.Fig.13. Illustration for the process of combining graphic primitives: one iteration reduces the number of newly obtained graphic primitives.

Фиг.14. Система черновой печати посредством преобразования картинок в контурные эскизы.Fig.14. Draft printing system by converting pictures to outline sketches.

Заявляемый способ включает в себя последовательные действия, представленные на блок-схеме, приведенной на Фиг.2:The inventive method includes sequential steps presented in the flowchart shown in Figure 2:

- выполняется предварительный анализ данных, посылаемых на печать, с целью выявления в них графических элементов (этап 201). При этом записи метафайла (или языка описания страницы) распознаются в соответствии с классификатором записей, принятым для данной формы представления. Выявленные записи, описывающие графические примитивы, извлекаются из набора данных с целью их дальнейшей обработки. Эти записи могут описывать как растровые изображения, так и векторную графику;- a preliminary analysis of the data sent for printing is performed in order to identify graphic elements in them (step 201). In this case, the metafile (or page description language) records are recognized in accordance with the classifier of records adopted for this form of presentation. Identified records describing graphic primitives are retrieved from the data set for the purpose of their further processing. These entries can describe both raster images and vector graphics;

- выявленные графические примитивы объединяются в картинки в соответствии с их геометрической близостью (этап 202). Итогом этого действия являются группы графических примитивов, соответствующие вышеназванным картинкам. Эта операция выполняется путем анализа координат графических примитивов. Группирование примитивов необходимо, так как последующее создание контурных эскизов возможно лишь для целых картинок, а не для разрозненных графических элементов. Результаты объединения примитивов в группы представляются в виде формального описания (выбор формы описания произволен);- identified graphic primitives are combined into pictures in accordance with their geometric proximity (step 202). The result of this action are groups of graphic primitives corresponding to the above pictures. This operation is performed by analyzing the coordinates of graphic primitives. Grouping primitives is necessary, since the subsequent creation of contour sketches is possible only for whole pictures, and not for disparate graphic elements. The results of combining primitives into groups are presented in the form of a formal description (the choice of the description form is arbitrary);

- для каждой созданной группы графических примитивов, объединяемых в картинку, создается контурный эскиз. Эта операция может быть сделана, например, путем создания вспомогательного растрового изображения: полученная группа графических примитивов трансформируется в растровое изображение (этап 203). Для полученного растрового изображения строится контурный эскиз (этап 204). Для построения контурного эскиза применяется любой из способов, основанных на выделении в рисунке линий в местах контрастных переходов и подавлении областей с монотонной закраской;- for each created group of graphic primitives united in a picture, an outline sketch is created. This operation can be done, for example, by creating an auxiliary bitmap: the resulting group of graphic primitives is transformed into a bitmap (step 203). A contour sketch is constructed for the resulting bitmap image (step 204). To construct a contour sketch, any of the methods is used based on the selection in the drawing of lines in places of contrasting transitions and the suppression of areas with monotonous shading;

- созданный контурный эскиз в качестве новой записи добавляется в метафайл (или язык описания страницы), описывающий данные, предназначенные для печати. При этом, по меньшей мере, часть прежних записей, описывающих графические примитивы, объединенные в картинку, удаляется. Таким образом, выполняется модификация данных, предназначенных для печати: записи сгруппированных в картинку графических примитивов заменяются на запись контурного эскиза, созданного на основе этих элементов (этап 205). Неполное удаление исходных записей применяется в тех случаях, когда требуется сохранить частично исходные графические примитивы: например, оставить те из них, что формировали граничную рамку картинки;- the created outline sketch as a new record is added to the metafile (or page description language) that describes the data intended for printing. At the same time, at least part of the previous entries describing the graphic primitives combined into a picture is deleted. Thus, the data intended for printing is modified: the records of the graphic primitives grouped into the picture are replaced by the record of the outline sketch created on the basis of these elements (step 205). Incomplete deletion of source records is used in cases where it is necessary to partially save the original graphic primitives: for example, to leave those that formed the boundary frame of the picture;

- модифицированные данные выводятся на печатающее устройство (этап 206).- the modified data is output to a printing device (step 206).

Предполагается, что задание на печать (поток печатаемых данных) представлено либо языком описания страниц (PDL), либо метафайлом. Такое структурированное представление содержит записи (именуемые также «тегами» или «командами»), описывающие текстовые данные и графические примитивы.It is assumed that the print job (print data stream) is represented by either a page description language (PDL) or a metafile. Such a structured representation contains entries (also referred to as “tags” or “commands”) describing text data and graphic primitives.

В предпочтительной реализации описываемый способ использует в качестве данных файл спулинга принтера. Печатаемые страницы в этом случае образуют отдельные задания и представлены метафайлами (формата EMF в операционной системе Windows) - по одному метафайлу на каждую распечатываемую страницу. Способ применим также и к иным форматам представления данных, имеющих аналогичную структуру, например, к PDF-файлам.In a preferred embodiment, the described method uses a printer spool file as data. In this case, the printed pages form separate tasks and are represented by metafiles (EMF format in the Windows operating system) - one metafile for each printed page. The method is also applicable to other data presentation formats having a similar structure, for example, to PDF files.

Основной целью описываемого способа является модификация задания на печать для каждой страницы (представленной, например, в EMF формате), как показано на Фиг.3. Ниже приводится более детальное описание перечисленных выше этапов.The main purpose of the described method is to modify the print job for each page (presented, for example, in EMF format), as shown in Fig.3. The following is a more detailed description of the steps listed above.

На первом этапе проводится классификация записей метафайла (задания на печать) в соответствии со спецификацией конкретного формата данных. В предпочтительной реализации используется EMF-формат (Enhanced MetaFile), поэтому записи классифицируются в соответствии со спецификацией EMF. В результате выявляются записи - графические примитивы (это могут быть как растровые изображения, так и элементы векторной графики).At the first stage, the classification of metafile records (print jobs) is carried out in accordance with the specification of a particular data format. The preferred implementation uses the EMF format (Enhanced MetaFile), so records are classified according to the EMF specification. As a result, records are revealed - graphic primitives (these can be both raster images and elements of vector graphics).

После выявления графических примитивов проводится группирование этих примитивов в картинки. Этот этап представляется необходимым по следующим причинам.After identifying graphic primitives, these primitives are grouped into pictures. This step seems necessary for the following reasons.

Печатаемый метафайл содержит смесь записей, описывающих различные графические элементы (примитивы) - растровые изображения, прямые линии, кривые, полигоны, различные фигуры и т.п. В общем случае эти записи не скомпонованы в объекты, а лежат в метафайле в произвольном порядке. Поэтому непосредственное выявление графических примитивов в метафайле ничего не говорит об их взаимосвязи и о компоновке картинок, воспринимаемых человеческим глазом.The printed metafile contains a mixture of records describing various graphic elements (primitives) - raster images, straight lines, curves, polygons, various shapes, etc. In the general case, these records are not arranged in objects, but lie in a metafile in random order. Therefore, the direct identification of graphic primitives in a metafile does not say anything about their relationship and the layout of pictures perceived by the human eye.

В общем случае операция построения контурного эскиза не имеет смысла для отдельно взятого графического примитива. Она имеет смысл только для картинки в целом. На первый взгляд это утверждение не очевидно, поэтому подтвердим его несколькими примерами.In the general case, the operation of constructing a contour sketch does not make sense for a single graphic primitive. It only makes sense for the picture as a whole. At first glance, this statement is not obvious, therefore, we confirm it with several examples.

Первый пример - комбинация цветных прямоугольников, соприкасающихся сторонами (Фиг.4). В исходном метафайле каждый такой прямоугольник является графическим примитивом и описывается отдельной записью. В данном примере прямоугольники не имеют окрашенных периметров (рамок), а содержат только закрашенные внутренние области. Невозможно говорить о построении контурного эскиза путем обработки из этих прямоугольников в отдельности: если мы уничтожим внутреннюю закраску каждого из них, то вся картинка просто исчезнет. Мы не получим сетки из цветных рамок, как хотелось бы при построении эскиза.The first example is a combination of colored rectangles touching the sides (Figure 4). In the source metafile, each such rectangle is a graphic primitive and is described by a separate entry. In this example, the rectangles do not have colored perimeters (frames), but contain only filled inner areas. It is impossible to talk about constructing a contour sketch by processing these rectangles separately: if we destroy the inner shading of each of them, then the whole picture will simply disappear. We won’t get grids from colored frames, as we would like when sketching.

Следующий пример - картинка, составленная из маленьких растровых изображений, представляющих собой полосы шириной в один пиксель (Фиг.5). В метафайле каждая такая полоска представлена отдельной записью. Операцию построения контурного эскиза невозможно применить к отдельно взятой полоске пикселей - для этого требуется вся картинка в целом, но разрозненные записи метафайла не дают представления о целой картинке.The next example is a picture made up of small bitmap images, which are stripes with a width of one pixel (Figure 5). In the metafile, each such strip is represented by a separate entry. The operation of constructing a contour sketch cannot be applied to a single strip of pixels - this requires the whole picture as a whole, but the scattered metafile records do not give an idea of the whole picture.

Похожая ситуация возникает, когда картинка построена по принципу линогравюры - как комбинация отдельных цветовых линий (полос). Такая «линогравюра» может состоять, например, из цветных линий векторной графики.A similar situation occurs when a picture is built on the principle of linocut - as a combination of individual color lines (stripes). Such "linocut" may consist, for example, of colored lines of vector graphics.

Наконец, может иметь место комбинация любых графических примитивов: например, растрового изображения с наложенными на него элементами векторной графики. В этом случае при построении контурного эскиза важно учесть сочетание всех этих составных частей картинки.Finally, there may be a combination of any graphic primitives: for example, a raster image with vector graphics elements superimposed on it. In this case, when constructing a contour sketch, it is important to consider the combination of all these components of the picture.

Вышеприведенные примеры показывают, что операция построения контурного эскиза имеет смысл только для картинки в целом, а не для отдельных графических примитивов (в частном случае, конечно, отдельный примитив может являться растровым изображением, тождественным картинке, но такое бывает далеко не всегда). Вот почему требуется процесс группирования графических примитивов в картинки.The above examples show that the operation of constructing a contour sketch makes sense only for the picture as a whole, and not for individual graphic primitives (in the particular case, of course, a single primitive can be a bitmap image that is identical to the picture, but this does not always happen). That is why the process of grouping graphic primitives into pictures is required.

Для лучшего понимания вышеназванной операции группирования объясним предварительно следующие понятия: что является основным свойством картинки, что такое наложение графических примитивов, что такое одна итерация группирования графических примитивов и как на ее основе строится весь процесс объединения примитивов в картинки.To better understand the above grouping operation, we will first explain the following concepts: what is the main property of a picture, what is the imposition of graphic primitives, what is one iteration of grouping graphic primitives, and how is the whole process of combining primitives into pictures based on it.

Точного определения для термина «картинка» не существует. Условимся понимать под картинкой такое сочетание графических элементов (точек, пятен, линий, форм) на плоскости, которое визуально воспринимается человеческим глазом как единое целое. Иными словами, главным характерным свойством картинки является ее цельность при восприятии человеческим глазом. Например, на Фиг.6.1 приведена печатная страница, содержащая четыре картинки (в соответствии с визуальным восприятием). В действительности только две из этих картинок являются буквально растровыми изображениями 101, а две другие картинки 102 представляют собой комбинации разрозненных графических примитивов - линий и элементарных форм. Фиг.6.2 иллюстрирует ситуацию, когда несколько графических элементов расположены поодаль друг от друга, но человеческий глаз воспринимает их как цельную картинку. Приведенные иллюстрации демонстрируют, что человеческий глаз без труда объединяет графические примитивы в картинки.There is no exact definition for the term “picture”. Let us agree to understand by a picture such a combination of graphic elements (dots, spots, lines, shapes) on a plane that is visually perceived by the human eye as a whole. In other words, the main characteristic property of a picture is its integrity when perceived by the human eye. For example, Fig. 6.1 shows a printed page containing four pictures (in accordance with visual perception). In fact, only two of these pictures are literally bitmap images 101, and the other two pictures 102 are combinations of disparate graphic primitives - lines and elementary forms. Fig.6.2 illustrates the situation when several graphic elements are located at a distance from each other, but the human eye perceives them as a whole picture. The above illustrations demonstrate that the human eye easily combines graphic primitives into pictures.

Вышеприведенное детальное разъяснение понятия «картинка» важно для понимания дальнейшего изложения метода, так как операции построения контурного эскиза применимы именно к картинкам, а не к разрозненным графическим примитивам.The above detailed explanation of the concept of “picture” is important for understanding the further presentation of the method, since the operations of constructing a contour sketch are applicable specifically to pictures, and not to disparate graphic primitives.

Цельность картинки является ключевым свойством для группирования графических примитивов. В основе процесса лежит идея геометрической близости отдельных элементов. Считается, что графические примитивы могут быть сгруппированы в картинку, если они геометрически перекрываются или расположены «достаточно близко» (близость расположения может быть выражена формально через геометрическое расстояние).Image integrity is a key property for grouping graphic primitives. The process is based on the idea of the geometric proximity of individual elements. It is believed that graphic primitives can be grouped into a picture if they geometrically overlap or are located “close enough” (proximity of a location can be expressed formally in terms of geometric distance).

Заявляемый способ подразумевает, что графические примитивы снабжены описанием в виде набора геометрических параметров. Форма такого описания произвольна, но оно включает в себя, по меньшей мере, геометрические координаты элементов, позволяющие вычислить локализацию примитивов на плоскости. Например, для растрового изображения такими параметрами являются координаты вершин прямоугольника изображения. Для элементов векторной графики это могут быть радиусы окружностей и координаты центров, координаты вершин полигонов, составных линий и т.п. Единицы измерения для геометрического описания могут быть выбраны произвольно: метры, миллиметры, пиксели. Например, в описываемой предпочтительной реализации используются пиксели.The inventive method implies that the graphic primitives are provided with a description in the form of a set of geometric parameters. The form of such a description is arbitrary, but it includes at least the geometrical coordinates of the elements, which make it possible to calculate the localization of primitives on the plane. For example, for a raster image, such parameters are the coordinates of the vertices of the image rectangle. For elements of vector graphics, these can be the radii of circles and the coordinates of centers, the coordinates of the vertices of polygons, composite lines, etc. Units of measure for a geometric description can be arbitrarily selected: meters, millimeters, pixels. For example, in the described preferred implementation, pixels are used.

Описание графического примитива подразумевает определение его зоны локализации. Мы в тексте документа называем эту зону также «граничной зоной», подчеркивая этим названием, что зона охватывает графический примитив снаружи. В качестве такой граничной зоны может быть выбран любой описанный многоугольник, охватывающий графический примитив в соответствии с правилами геометрии. В предпочтительной реализации в качестве граничных зон используются описанные прямоугольники (bounding boxes) (Фиг.7), поскольку эта фигура наиболее проста с точки зрения вычислений. Эти прямоугольники имеют стороны, параллельные осям координат, и представлены координатами своих вершин. Вышеназванные «граничные зоны» в виде прямоугольников используются при сопоставлении графических примитивов при их группировании в картинки.The description of a graphic primitive implies the determination of its localization zone. In the text of the document, we call this zone also the “boundary zone”, emphasizing with this name that the zone covers the graphic primitive from the outside. As such a boundary zone, any described polygon can be selected, covering the graphic primitive in accordance with the rules of geometry. In the preferred implementation, the described rectangles (bounding boxes) are used as boundary zones (Fig. 7), since this figure is the simplest from the point of view of calculations. These rectangles have sides parallel to the coordinate axes and are represented by the coordinates of their vertices. The above-mentioned "boundary zones" in the form of rectangles are used when comparing graphic primitives when grouping them into pictures.

Основной идеей группирования графических примитивов по их геометрической близости является перекрытие (наложение) их «граничных зон». В предпочтительной реализации используется следующее правило: два графических примитива считаются перекрывающимися, если их граничные зоны (описанные прямоугольники) перекрываются (Фиг.8) либо расположены «достаточно близко» в соответствии с заданными допустимыми расстояниями (Фиг.9). В предпочтительной реализации эти допустимые расстояния задаются раздельно по каждой из двух координат и отсчитываются от сторон прямоугольников. Собственно анализ пересечения двух прямоугольников на плоскости является тривиальной геометрической задачей.The basic idea of grouping graphic primitives by their geometric proximity is to overlap (overlap) their “boundary zones”. In the preferred implementation, the following rule is used: two graphic primitives are considered to overlap if their boundary zones (the described rectangles) overlap (Fig. 8) or are located "close enough" in accordance with the specified allowable distances (Fig. 9). In a preferred implementation, these allowable distances are set separately for each of the two coordinates and are counted from the sides of the rectangles. Actually, the analysis of the intersection of two rectangles on a plane is a trivial geometric problem.

Этап группирования графических примитивов в картинки представляет собой итерационный процесс. Сначала исходные примитивы объединяются в группы, затем полученные группы объединяются в еще более крупные группы и т.д.The stage of grouping graphic primitives into pictures is an iterative process. First, the original primitives are combined into groups, then the resulting groups are combined into even larger groups, etc.

Одна итерация группирования графических примитивов иллюстрируется блок-схемой на Фиг.10 и состоит из следующих этапов:One iteration of grouping graphic primitives is illustrated in the flowchart of FIG. 10 and consists of the following steps:

- исходные данные представляют собой список графических примитивов (этап 1001); для формирования групп также выделяется список, но на начальном этапе он пуст;- the source data is a list of graphic primitives (step 1001); a list is also allocated to form groups, but at the initial stage it is empty;

- очередной графический примитив извлекается из списка примитивов (этап 1003) для сравнения со списком полученных групп;- the next graphic primitive is extracted from the list of primitives (step 1003) for comparison with the list of received groups;

- если список групп пока еще пуст, то исследуемый графический примитив рассматривается как первая группа, включаемая в список (этап 1005). Этот примитив является пока что единственным элементом, входящим в группу, а его граничный прямоугольник становится граничным прямоугольником созданной группы. В этом случае происходит возврат к этапу извлечения следующего примитива из списка (этап 1003);- if the list of groups is still empty, then the studied graphic primitive is considered as the first group included in the list (step 1005). This primitive is so far the only element in the group, and its boundary rectangle becomes the boundary rectangle of the created group. In this case, there is a return to the step of extracting the next primitive from the list (step 1003);

- если список групп не пуст, исследуемый примитив сравнивается с каждой группой из списка (этап 1004) вплоть до обнаружения факта перекрытия с одной из групп (анализируется перекрытие соответствующих граничных прямоугольников);- if the list of groups is not empty, the studied primitive is compared with each group from the list (step 1004) until the fact of overlapping with one of the groups is detected (the overlap of the corresponding boundary rectangles is analyzed);

- если не обнаружено перекрытия исследуемого примитива ни с одной из групп, то он не может быть объединен ни с одной из рассмотренных групп. В этом случае исследуемый примитив образует новую группу в списке (этап 1005), его граничный прямоугольник становится граничным прямоугольником созданной группы. В этом случае происходит возврат к этапу извлечения следующего примитива из списка примитивов (этап 1003);- if no overlap of the studied primitive was found with any of the groups, then it cannot be combined with any of the considered groups. In this case, the primitive under study forms a new group in the list (step 1005), its boundary rectangle becomes the boundary rectangle of the created group. In this case, there is a return to the step of extracting the next primitive from the list of primitives (step 1003);

- если обнаруживается перекрытие исследуемого примитива с одной из групп, то примитив включается в эту группу. Граничный прямоугольник группы модифицируется - пересчитывается таким образом, чтобы охватить новый включенный в нее элемент. Таким образом, в этом случае список групп не увеличивается, но одна из групп пополняется новым элементом (этап 1006). В этом случае происходит возврат к этапу извлечения очередного графического примитива из списка примитивов.- if an overlap of the studied primitive with one of the groups is detected, then the primitive is included in this group. The boundary rectangle of the group is modified - recalculated in such a way as to cover the new element included in it. Thus, in this case, the list of groups does not increase, but one of the groups is replenished with a new element (step 1006). In this case, there is a return to the step of extracting the next graphic primitive from the list of primitives.

- процесс заканчивается, если обработаны все примитивы в списке примитивов (этап 1007). Результатом является список групп, объединяющих в себе графические примитивы по принципу геометрической близости.- the process ends if all the primitives in the list of primitives are processed (step 1007). The result is a list of groups combining graphic primitives based on the principle of geometric proximity.

В предпочтительной реализации при анализе перекрытия граничных прямоугольников учитывается возможность их «близкого расположения» в соответствии с заданным допустимым расстоянием. Этот учет не меняет этапов вышеописанного процесса, а относится только к этапу сравнения граничных прямоугольников.In a preferred implementation, when analyzing the overlapping of boundary rectangles, the possibility of their “close proximity” in accordance with a given allowable distance is taken into account. This accounting does not change the stages of the above process, but applies only to the stage of comparison of boundary rectangles.

Описанный выше процесс является составной частью - одной итерацией - всего процесса объединения графических примитивов в картинки. Если полученные группы примитивов, в свою очередь, перекрываются, то они могут быть объединены в более крупные группы (ситуация иллюстрируется на Фиг.11). Вот почему полный процесс объединения графических примитивов в картинки содержит множество итераций, описанных выше.The process described above is an integral part - one iteration - of the whole process of combining graphic primitives into pictures. If the obtained groups of primitives, in turn, overlap, then they can be combined into larger groups (the situation is illustrated in Fig. 11). That is why the complete process of combining graphic primitives into pictures contains many iterations described above.

Полный процесс объединения графических примитивов в картинки иллюстрируется на Фиг.12 и содержит следующие этапы:The complete process of combining graphic primitives into pictures is illustrated in Fig. 12 and contains the following steps:

- на начальном этапе процесса все графические примитивы (для каждого из которых определен его граничный прямоугольник) объединяются в список и рассматриваются как кандидаты на группирование в картинки (этапы 1201 и 1202);- at the initial stage of the process, all graphic primitives (for each of which its boundary rectangle is defined) are combined into a list and considered as candidates for grouping into pictures (steps 1201 and 1202);

- выполняется одна итерация объединения графических примитивов в группы (этап 1203). Результатом является получаемый список групп, объединяющих в себе графические примитивы;- one iteration of combining graphic primitives into groups is performed (step 1203). The result is a list of groups combining graphic primitives;

- проверяются условия завершения итерационного процесса (этап 1205), детально эти условия описаны далее;- the conditions for completing the iterative process are checked (step 1205), these conditions are described in detail below;

- если итерационный процесс продолжается, то полученные группы рассматриваются как новые графические примитивы (этап 1206) и используются в качестве исходных данных для следующей итерации. Таким образом, очередная итерация создает новый список групп (этап 1202), как комбинацию ранее созданных групп (этап 1204);- if the iterative process continues, then the resulting groups are considered as new graphic primitives (step 1206) and are used as input data for the next iteration. Thus, the next iteration creates a new list of groups (step 1202), as a combination of previously created groups (step 1204);

- шаг за шагом каждая итерация уменьшает общее число групп, объединяя в них все большее число исходных графических примитивов (сказанное иллюстрируется на Фиг.13);- step by step, each iteration reduces the total number of groups, combining in them an increasing number of source graphic primitives (the foregoing is illustrated in Fig.13);

- когда процесс заканчивается в результате проверки условий завершения, итоговые группы в списке являются картинками, образованными из графических примитивов, и могут быть использованы для получения контурных эскизов (этап 1207).- when the process ends as a result of checking the completion conditions, the final groups in the list are pictures formed from graphic primitives and can be used to obtain contour sketches (step 1207).

Условие завершения процесса (этап 1205) подразумевает выполнение любого из двух правил:The termination condition (step 1205) implies the fulfillment of either of two rules:

- если в списке групп остается только одна группа. Это значит, что все графические примитивы объединены в одну картинку, и больше группировать нечего;- if only one group remains in the list of groups. This means that all graphic primitives are combined into one picture, and there is nothing more to group;

- если количество полученных на очередной итерации групп равно количеству исходных графических примитивов (или ранее полученных групп). Это значит, что исследуемые графические примитивы (или полученные из них группы) расположены далеко друг от друга и не могут быть объединены, т.е. образуют отдельные картинки.- if the number of groups received at the next iteration is equal to the number of source graphic primitives (or previously received groups). This means that the studied graphic primitives (or groups derived from them) are located far from each other and cannot be combined, i.e. form separate pictures.

В результате описанного выше процесса получаются картинки (по меньшей мере, одна), представленные как группы графических примитивов, объединенных на основе их геометрической близости. Заявляемый способ не регламентирует конкретного формального описания, выражающего принадлежность примитивов картинкам. Например, в предпочтительной реализации используются таблицы, в которых описываются как геометрические параметры примитивов и групп, так и признаки принадлежности их друг другу. В итоге каждая полученная группа, объединяющая в себе графические примитивы, трактуется как картинка и используется для получения контурного эскиза.As a result of the process described above, pictures (at least one) are obtained, presented as groups of graphic primitives, united on the basis of their geometric proximity. The inventive method does not regulate a specific formal description expressing the belonging of primitives to pictures. For example, in the preferred implementation, tables are used that describe both the geometric parameters of primitives and groups, as well as signs of their belonging to each other. As a result, each received group, combining graphic primitives, is treated as a picture and used to obtain a contour sketch.

Создание контурных эскизов на основе полученных картинок может быть выполнено как с привлечением растеризации этих картинок во вспомогательные растровые изображения, так и без этого.The creation of contour sketches based on the obtained images can be performed both with the help of rasterization of these images into auxiliary raster images, and without it.

Подход без растеризации применим только для частного случая, когда картинка состоит из векторных графических элементов, которые не перекрываются и имеют явно выраженные границы и закрашенные внутренние области. В этом случае закраска внутренних областей подавляется, а границы векторных элементов выделяются, в результате чего комбинация таких модифицированных графических элементов при печати выглядит как контурный эскиз. Но в общем случае такой подход неприменим.The approach without rasterization is applicable only for the special case when the picture consists of vector graphic elements that do not overlap and have distinct borders and filled inner areas. In this case, the shading of the inner areas is suppressed, and the borders of the vector elements are highlighted, as a result of which the combination of such modified graphic elements looks like a contour sketch when printing. But in the general case, this approach is not applicable.

В предпочтительной реализации для создания контурного эскиза используется получение вспомогательных растровых изображений для каждой из полученных картинок (этап 2003 на Фиг.2). В описываемом конкретном случае вспомогательное растровое изображение получается с помощью функций MS-Windows GDI (Graphic Device Interface). Ниже перечислены основные этапы этого процесса (для иных операционных систем используются аналогичные функции, в целом подход остается таким же):In a preferred embodiment, auxiliary raster images for each of the obtained images are used to create an outline sketch (step 2003 in FIG. 2). In this particular case, an auxiliary raster image is obtained using the MS-Windows GDI (Graphic Device Interface) functions. The main stages of this process are listed below (similar functions are used for other operating systems, the whole approach remains the same):

- подготовка (с помощью функций GDI) для целой печатаемой страницы так называемых «Совместимого DC (Device Context)» и «Совместимого растрового изображения» (внутреннего изображения в памяти);- preparation (using the GDI functions) for the whole printed page of the so-called “Compatible DC (Device Context)” and “Compatible bitmap image” (internal image in memory);

- воспроизведение метафайла в вышеназванном «Совместимом DC» (с помощью функций GDI), причем воспроизводятся все записи за исключением текстовых. Таким образом, в результате получается растровое изображение (в оперативной памяти), содержащее графические элементы и не содержащее текстовых записей;- Playback of the metafile in the aforementioned “Compatible DC” (using the GDI functions), and all records except text ones are played back. Thus, the result is a bitmap image (in RAM) containing graphic elements and not containing text entries;

- выделение вспомогательного буфера памяти, соответствующего полученному растровому изображению страницы по размерам и разрешающей способности в пикселях;- allocation of auxiliary memory buffer corresponding to the received bitmap image of the page in size and resolution in pixels;

- перенос полученного растрового изображения в вышеназванный вспомогательный буфер;- transfer of the received raster image to the above auxiliary buffer;

- локализация отдельных картинок (как фрагментов общего страничного растрового изображения) в вышеназванном буфере и перенос их в отдельные локальные буферы. Для локализации фрагментов в страничном буфере используются координаты граничных (описанных) прямоугольников, полученные ранее при группировании примитивов в картинки: они как раз соответствуют требуемым границам отдельных картинок в страничном буфере;- localization of individual images (as fragments of a common page raster image) in the above buffer and transferring them to separate local buffers. To localize fragments in the page buffer, the coordinates of the boundary (described) rectangles obtained earlier when grouping primitives into pictures are used: they just correspond to the required boundaries of the individual pictures in the page buffer;

В результате получаются картинки, представленные как отдельные растровые изображения. Эти изображения используются для получения контурных эскизов.The result is pictures presented as separate bitmap images. These images are used to create outline sketches.

В предпочтительной реализации изобретения для получения контурного эскиза используется процесс, этапы которого перечислены ниже (процесс годится как для цветного изображения, так и для изображения в градациях серого или монохромного):In a preferred embodiment of the invention, a process is used to obtain an outline sketch, the steps of which are listed below (the process is suitable for both a color image and an image in grayscale or monochrome):

- предобработка растрового изображения. В частности, в предпочтительной реализации на этом этапе выполняется сглаживающая фильтрация, повышение контраста, выделение визуальных особенностей изображения, например на основе построения карты важности (см. Wen-Fu Lee, Tai-Hsiang Huang, Yi-Hsin Huang, Mei-Lan Chu, и Homer H. Chen, SPIE-IS&T/ Vol.7240, 2009) [7];- preprocessing a bitmap image. In particular, in the preferred implementation at this stage, smoothing filtering, increasing contrast, highlighting the visual features of the image, for example, based on building a map of importance, is performed (see Wen-Fu Lee, Tai-Hsiang Huang, Yi-Hsin Huang, Mei-Lan Chu, and Homer H. Chen, SPIE-IS & T / Vol. 7240, 2009) [7];

- создание копии изображения в градациях серого (если исходное изображение изначально представлено в градациях серого, этот этап не требуется);- creating a copy of the image in grayscale (if the original image was originally presented in grayscale, this step is not required);

- выделение контуров в полученной копии изображения в градациях серого. Получение бинарной маски, выделяющей эти контуры и подавляющей прочие участки изображения. В частности, в предпочтительной реализации используется выявление контуров с помощью Разностно-Гауссовой фильтрации (Difference-of-Gaussians, DoG) и порогового отсечения получаемых значений;- selection of the contours in the resulting copy of the image in grayscale. Getting a binary mask that selects these contours and suppresses other parts of the image. In particular, in the preferred implementation, the detection of contours using Difference-of-Gaussians (DoG) and a threshold cutoff of the obtained values is used;

- применение полученной бинарной маски для выделения контурных линий в вышеназванном растровом изображении. Для цветных изображений маска используется для каждого цветового канала. Маска сохраняет только те пиксели изображения, которые соответствуют найденным контурным линиям. В результате получается изображение - контурный эскиз.- application of the obtained binary mask to highlight contour lines in the above bitmap image. For color images, a mask is used for each color channel. The mask saves only those pixels of the image that correspond to the found contour lines. The result is an image - a contour sketch.

Как было упомянуто ранее, получение контурного эскиза на основе предварительно созданного растрового изображения - не единственно возможный подход. Иной подход может быть использован в частном случае, когда картинка состоит только из элементов векторной графики. В этом случае можно не получать вспомогательного растрового изображения и не применять выделение контурных линий фильтрационными методами. Достаточно подавить внутреннюю закраску элементов векторной графики и выделить их контурные линии, если, конечно, данные это позволяют. В этом случае результат - контурный эскиз - будет представлен не в форме растрового изображения, а в виде совокупности графических примитивов с измененными характеристиками. Однако такой подход применим лишь для частных случаев.As mentioned earlier, getting an outline sketch based on a previously created bitmap is not the only possible approach. A different approach can be used in the particular case when the picture consists only of elements of vector graphics. In this case, it is possible not to obtain an auxiliary raster image and not to use the selection of contour lines by filtration methods. It is enough to suppress the inner shading of the elements of vector graphics and select their contour lines, if, of course, the data allow this. In this case, the result - a contour sketch - will be presented not in the form of a raster image, but as a combination of graphic primitives with changed characteristics. However, this approach is applicable only for special cases.

Итак, для каждой полученной картинки созданы контурные эскизы (в предпочтительной реализации они являются растровыми изображениями). Эти контурные эскизы используются в выходном задании на печать как новые графические примитивы взамен исходных, на основе которых были получены картинки. В предпочтительной реализации модификация задания на печать предполагает создание нового метафайла (EMF) взамен исходного, в который полученные контурные эскизы внедряются как записи с помощью функций графического интерфейса (GDI). Все другие записи исходного метафайла (например, описывающие текстовые блоки) копируются в вышеназванный выходной метафайл из исходного. При этом исходные графические примитивы, на основе которых создавались картинки и контурные эскизы, исключаются из выходного метафайла (исключается, по меньшей мере, часть этих примитивов). В предпочтительной реализации опционально может быть сохранена часть этих примитивов; например, горизонтальные и вертикальные линии, образующие рамки таблиц. В описываемой реализации возможно также опциональное подавление текстовых и графических записей при формировании модифицированного задания на печать. В итоге сформированное модифицированное задание на печать (метафайл) растеризуется и печатается.So, for each resulting image, contour sketches are created (in the preferred implementation, they are bitmap images). These contour sketches are used in the output print task as new graphic primitives instead of the original ones, on the basis of which the pictures were obtained. In a preferred implementation, modifying a print job involves creating a new metafile (EMF) instead of the original one, into which the resulting outline sketches are embedded as records using the graphical interface (GDI) functions. All other records of the source metafile (for example, describing text blocks) are copied to the above output metafile from the source. In this case, the original graphic primitives, on the basis of which pictures and contour sketches were created, are excluded from the output metafile (at least some of these primitives are excluded). In a preferred implementation, a portion of these primitives may optionally be stored; for example, horizontal and vertical lines forming table frames. In the described implementation, optional suppression of text and graphic records is also possible during the formation of a modified print job. As a result, the generated modified print job (metafile) is rasterized and printed.

На Фиг.14 представлена блок-схема заявляемой системы, реализующей описанный выше способ. Система содержит модули, перечисленные ниже:On Fig presents a block diagram of the inventive system that implements the above method. The system contains the modules listed below:

- модуль 1401 анализа записей исходного задания на печать;- module 1401 analysis of the records of the original print job;

- модуль 1402 объединения графических примитивов в картинки;- module 1402 combining graphic primitives into pictures;

- модуль 1403 преобразования картинок в контурные эскизы;- module 1403 converting pictures into contour sketches;

- модуль 1404 итоговой сборки задания на печать;- module 1404 of the final assembly of the print job;

- модуль 1405 растеризации и печати.- module 1405 rasterization and printing.

Исходными данными для системы является задание на печать, представленное языком описания страниц (PDL) либо метафайлом. Исходные данные содержат записи, описывающие, в частности, текстовые элементы, растровые изображения и элементы векторной графики. Выходными данными является модифицированное задание на печать, предназначенное для использования в экономичной черновой печати.The initial data for the system is a print job represented by a page description language (PDL) or a metafile. The source data contains records describing, in particular, text elements, raster images and vector graphics elements. The output is a modified print job for use in cost-effective draft printing.

Модуль 1401 анализа записей классифицирует записи исходных данных в соответствии со спецификацией метафайла (или языка описания страниц). Он извлекает записи графических примитивов и направляет их в модуль 1402 объединения примитивов в картинки и в модуль 1404 итоговой сборки. Все прочие записи направляются только в модуль 1404 итоговой сборки.The record analysis module 1401 classifies the source data records in accordance with the specification of the metafile (or page description language). It extracts the entries of the graphic primitives and directs them to the module 1402 combining primitives into pictures and the module 1404 of the final assembly. All other records are sent only to the final assembly module 1404.

Модуль 1402 объединения графических примитивов группирует эти примитивы в картинки на основе их геометрической близости. Этот модуль работает в соответствии с процессом, описанным выше. Анализируется геометрия графических примитивов; если граничные (описанные) прямоугольники примитивов перекрываются либо располагаются достаточно близко друг к другу (в соответствии с заданным допустимым расстоянием), то такие примитивы подлежат объединению в группу. Полученные в результате группы графических примитивов трактуются как картинки, в дальнейшем на их основе создаются контурные эскизы.A module for combining graphic primitives 1402 groups these primitives into pictures based on their geometric proximity. This module operates in accordance with the process described above. The geometry of graphic primitives is analyzed; if the boundary (described) rectangles of primitives overlap or are located close enough to each other (in accordance with a given allowable distance), then such primitives must be grouped. The resulting groups of graphic primitives are treated as pictures, in the future, based on them, contour sketches are created.

Вышеназванные картинки (представленные группами объединенных графических примитивов) подаются в модуль 1403 преобразования в контурные эскизы, который создает вышеназванные эскизы (в предпочтительной реализации контурные эскизы - это растровые изображения, в которых выделены контурные линии и подавлена однородная закраска областей). Созданные эскизы передаются на модуль 1404 сборки.The above images (represented by groups of combined graphic primitives) are supplied to the contour sketches conversion module 1403, which creates the aforementioned sketches (in the preferred implementation, contour sketches are bitmap images in which contour lines are highlighted and uniform filling of areas is suppressed). Created sketches are transmitted to assembly module 1404.

Модуль 1404 итоговой сборки принимает полученные контурные эскизы с модуля 1403 преобразования картинок в эскизы наряду со всеми остальными записями исходного метафайла, классифицированными модулем 1401 анализа. Он создает модифицированное задание на печать, представляющее собой новый метафайл, в который включаются полученные контурные эскизы (в виде записей - растровых изображений), а также (опционально) другие записи, полученные с модуля 1401 анализа. Модуль 1404 итоговой сборки выполнен с возможностью выборочного подавления записей определенного типа. Например, он подавляет, по меньшей мере, часть графических примитивов, на основе которых были созданы контурные эскизы, поскольку полученные контурные эскизы включены в выходной метафайл вместо них. В то же время часть графических примитивов может быть опционально сохранена: например, горизонтальные и вертикальные линии, образующие сетку таблиц.The final assembly module 1404 receives the received outline sketches from the image-to-thumbnail conversion module 1403 along with all other records of the original metafile classified by the analysis module 1401. He creates a modified print job, which is a new metafile, which includes the resulting outline sketches (in the form of records - bitmap images), as well as (optionally) other records received from the analysis module 1401. The final assembly module 1404 is configured to selectively suppress records of a particular type. For example, it suppresses at least part of the graphic primitives on the basis of which the outline sketches were created, since the resulting outline sketches are included in the output metafile instead of them. At the same time, part of the graphic primitives can be optionally saved: for example, horizontal and vertical lines forming a grid of tables.

Модуль 1404 итоговой сборки посылает модифицированное задание на печать в модуль 1405 растеризации и печати. Модуль 1405 растеризации и печати растеризует модифицированные данные и выводит на печать.The final assembly module 1404 sends the modified print job to the rasterization and printing module 1405. The rasterization and printing module 1405 rasterizes the modified data and prints it.

Предлагаемые способ и система предназначены для использования в принтерах и многофункциональных устройствах (цветных или монохромных) для обеспечения экономичного чернового режима печати (экономия чернил или тонера). Они могут быть также реализованы в драйверах вышеназванных устройств.The proposed method and system are intended for use in printers and multifunction devices (color or monochrome) to provide an economical draft mode of printing (saving ink or toner). They can also be implemented in the drivers of the above devices.

Предлагаемые способ и система применимы для всех видов заданий на печать, представленных в формате метафайла (например, EMF, MS-EMFSPOOL) или языка описания страниц (такого, как PCL, PS, PDF), поскольку все эти форматы базируются на представлении данных в виде записей («тегов»), описывающих текстовые данные, растровые изображения и векторную графику.The proposed method and system is applicable for all types of print jobs presented in a metafile format (for example, EMF, MS-EMFSPOOL) or a page description language (such as PCL, PS, PDF), since all these formats are based on the presentation of data in the form records (“tags”) describing text data, bitmap images and vector graphics.

Следует отметить, что указанный выше вариант выполнения изобретения был изложен с целью иллюстрации, и специалистам должно быть ясно, что возможны разные модификации, добавления и замены, не выходящие из объема и смысла настоящего изобретения, заявленного в прилагаемой формуле изобретения.It should be noted that the above embodiment of the invention was set forth for purposes of illustration, and it should be apparent to those skilled in the art that various modifications, additions and substitutions are possible without departing from the scope and meaning of the present invention as claimed in the appended claims.

Claims (8)

1. Способ черновой печати посредством преобразования картинок в контурные эскизы, заключающийся в выполнении следующих операций:
- извлекают графические примитивы из потока печатаемых данных или из задания на печать;
- объединяют вышеуказанные графические примитивы в картинки в соответствии с их геометрической близостью;
- преобразуют полученные картинки в контурные эскизы;
- модифицируют поток печатаемых данных или задание на печать путем замены, по меньшей мере, части графических примитивов на полученные контурные эскизы;
- печатают модифицированный поток данных или задание на печать.
1. The method of draft printing by converting images into contour sketches, which consists in the following operations:
- extract graphic primitives from the stream of printed data or from a print job;
- combine the above graphic primitives into pictures in accordance with their geometric proximity;
- convert the resulting pictures into contour sketches;
- modify the flow of printed data or the print job by replacing at least part of the graphic primitives with the resulting outline sketches;
- print a modified data stream or print job.
2. Способ по п.1, отличающийся тем, что объединяют графические примитивы в картинки путем выполнения следующих операций:
- находят для графических примитивов внешние границы в виде описанных прямоугольников;
- объединяют в картинки те графические примитивы, у которых описанные прямоугольники перекрываются.
2. The method according to claim 1, characterized in that the graphic primitives are combined into pictures by performing the following operations:
- find for graphic primitives external borders in the form of the described rectangles;
- combine those graphic primitives in which the described rectangles overlap.
3. Способ по п.1, отличающийся тем, что объединяют графические примитивы в картинки путем выполнения следующих операций:
- находят для графических примитивов внешние границы в виде описанных прямоугольников;
- назначают допуски на близость расположения примитивов в виде расстояний по координатам;
- объединяют в картинки те графические примитивы, у которых описанные прямоугольники либо перекрываются, либо располагаются по отношению друг к другу настолько близко, что стороны их отстоят на расстояния меньшие, чем назначенные допуски.
3. The method according to claim 1, characterized in that the graphic primitives are combined into pictures by performing the following operations:
- find for graphic primitives external borders in the form of the described rectangles;
- designate tolerances for the proximity of the primitives in the form of distances by coordinates;
- combine those graphic primitives in which the described rectangles either overlap or are located so close to each other that their sides are spaced less than the assigned tolerances.
4. Способ по п.1, отличающийся тем, что преобразование вышеуказанных полученных картинок в контурные эскизы заключается в выполнении следующих операций:
- каждую из вышеназванных картинок, представленную в виде комбинации графических примитивов, растеризуют во вспомогательное растровое изображение;
- преобразуют построенное растровое изображение в контурный эскиз.
4. The method according to claim 1, characterized in that the conversion of the above received images into contour sketches consists in performing the following operations:
- each of the above images, presented as a combination of graphic primitives, is rasterized into an auxiliary raster image;
- convert the constructed raster image into a contour sketch.
5. Способ по п.4, отличающийся тем, что полученные растровые изображения преобразуют в контурные эскизы способом, состоящим из следующих этапов:
- для каждого из вышеназванных растровых изображений строят его копию в градациях оттенков серого цвета;
- в полученной копии изображения в градациях серого цвета выявляют контуры и строят бинарную маску, выделяющую эти контуры и подавляющую прочие участки изображения;
- формируют контурный эскиз посредством применения полученной бинарной маски к вышеуказанному растровому изображению.
5. The method according to claim 4, characterized in that the resulting raster images are converted into contour sketches in a manner consisting of the following steps:
- for each of the above raster images build a copy of it in gradations of shades of gray;
- in the obtained copy of the image in shades of gray, the contours are detected and a binary mask is constructed that selects these contours and suppresses other parts of the image;
- form a contour sketch by applying the resulting binary mask to the above bitmap image.
6. Способ по п.1, отличающийся тем, что преобразование в контурный эскиз графических примитивов, объединенных в картинку, выполняют путем непосредственного выделения граничных линий и подавления закраски внутренних областей в вышеуказанных графических примитивах.6. The method according to claim 1, characterized in that the conversion into a contour sketch of the graphic primitives combined into a picture is performed by directly selecting the boundary lines and suppressing the shading of the inner areas in the above graphic primitives. 7. Способ по п.1, отличающийся тем, что при модификации потока печатаемых данных или задания на печать в модифицированные данные включают в непреобразованном виде те исходные графические примитивы, которые являются горизонтальными или вертикальными линиями.7. The method according to claim 1, characterized in that when modifying the stream of printed data or a print job, the modified data includes those original graphic primitives that are horizontal or vertical lines in an unreformed form. 8. Система черновой печати посредством преобразования картинок в контурные эскизы, отличающаяся тем, что содержит:
- модуль анализа записей потока печатаемых данных или задания на печать, выполненный с возможностью осуществления анализа таких записей путем разделения их на графические примитивы и прочие записи, с последующей передачей выделенных графических примитивов в модуль объединения графических примитивов и в модуль итоговой сборки, причем прочие записи передаются только в модуль итоговой сборки;
- модуль объединения графических примитивов, выполненный с возможностью приема вышеуказанных графических примитивов, объединения их в картинки в соответствии с их геометрической близостью и передачи полученных картинок в виде групп графических примитивов в модуль преобразования картинок в контурные эскизы;
- модуль преобразования картинок в контурные эскизы, выполненный с возможностью приема картинок, представленных группами объединенных графических примитивов, преобразования их в контурные эскизы путем выделения в них контуров и передачи полученных контурных эскизов в модуль итоговой сборки;
- модуль итоговой сборки задания на печать, выполненный с возможностью приема эскизов из модуля преобразования картинок в контурные эскизы и приема из модуля анализа записей всех прочих записей исходного задания, а также формирования модифицированного задания на печать путем замены, по меньшей мере, части графических примитивов на полученные контурные эскизы, с последующей передачей модифицированного задания в модуль растеризации и печати;
- модуль растеризации и печати, выполненный с возможностью приема модифицированного задания на печать, его растеризации и распечатки.
8. The system of draft printing by converting pictures into contour sketches, characterized in that it contains:
- a module for analyzing records of a stream of printed data or a print job, configured to analyze such records by dividing them into graphic primitives and other records, followed by transferring the selected graphic primitives to the module for combining graphic primitives and to the final assembly module, and other records are transmitted only in the final assembly module;
- a module for combining graphic primitives, configured to receive the above graphic primitives, combining them into pictures in accordance with their geometric proximity and transferring the resulting pictures as groups of graphic primitives to a module for converting pictures into contour sketches;
- a module for converting pictures into contour sketches, configured to receive pictures represented by groups of combined graphic primitives, converting them into contour sketches by selecting contours in them and transferring the resulting contour sketches to the final assembly module;
- a module for the final assembly of a print job, configured to receive thumbnails from the module for converting pictures to contour sketches and receive from the analysis module records of all other records of the original job, as well as the formation of a modified print job by replacing at least some of the graphic primitives with received outline sketches, with subsequent transfer of the modified task to the rasterization and printing module;
- a rasterization and printing module, configured to receive a modified print job, rasterize and print it.
RU2011138830/08A 2011-09-22 2011-09-22 System and method of draft mode printing by means of conversion of pictures into contour sketches RU2469399C1 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
RU2011138830/08A RU2469399C1 (en) 2011-09-22 2011-09-22 System and method of draft mode printing by means of conversion of pictures into contour sketches
EP12185521.7A EP2574033B1 (en) 2011-09-22 2012-09-21 Print controlling apparatus, image forming apparatus, and method for forming image
KR1020120104948A KR101899033B1 (en) 2011-09-22 2012-09-21 Print contolling apparatus, image forming apparatus and method for image forming
US13/623,985 US9036203B2 (en) 2011-09-22 2012-09-21 Print controlling apparatus, image forming apparatus, and method for forming image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
RU2011138830/08A RU2469399C1 (en) 2011-09-22 2011-09-22 System and method of draft mode printing by means of conversion of pictures into contour sketches

Publications (1)

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

Family

ID=48435178

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2011138830/08A RU2469399C1 (en) 2011-09-22 2011-09-22 System and method of draft mode printing by means of conversion of pictures into contour sketches

Country Status (2)

Country Link
KR (1) KR101899033B1 (en)
RU (1) RU2469399C1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2541132C1 (en) * 2013-07-26 2015-02-10 Федеральное государственное бюджетное образовательное учреждение высшего профессионального образования "Санкт-Петербургский государственный электротехнический университет "ЛЭТИ" им. В.И. Ульянова (Ленина)" Automatic sketch generation method and system therefor

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2258010C2 (en) * 1999-03-31 2005-08-10 Сейко Эпсон Корпорейшн Printing system, printing controller, printer, method for control of printing operation, method for printing, inn cartridge, ink source and ink carrier
US20060082825A1 (en) * 2004-10-19 2006-04-20 Samsung Electronics Co., Ltd. Print-data processing apparatus for processing print-data to print in correspondence with print-mode set on connected printing device and method thereof
RU2298293C2 (en) * 2004-06-04 2007-04-27 Корпорация "Самсунг Электроникс" System and method for correction of image during output to printing device
RU2323462C2 (en) * 2003-05-14 2008-04-27 Кэнон Кабусики Кайся Image forming device, a cartridge and a storage device mounted in the cartridge
RU2337009C2 (en) * 2004-07-06 2008-10-27 Кэнон Кабусики Кайся Method of data processing, device of data processing, method of mask generation and mask template
US20090290883A1 (en) * 2008-05-23 2009-11-26 Kabushiki Kaisha Toshiba Apparatus and method for adjusting toner consumption
US20100214614A1 (en) * 2009-02-23 2010-08-26 Andrew Rodney Ferlitsch Context-aware printing method and system
RU2405201C1 (en) * 2009-06-16 2010-11-27 Корпорация "САМСУНГ ЭЛЕКТРОНИКС Ко., Лтд." Method and system for reducing ink consumption when printing
US20110019213A1 (en) * 2009-07-23 2011-01-27 Samsung Electronics Co., Ltd. Toner saving method, toner saving system, and image forming apparatus

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6226015B1 (en) * 1998-02-25 2001-05-01 Intel Corporation Method of automatically producing sketches and cartoon images from movies
US7567715B1 (en) * 2004-05-12 2009-07-28 The Regents Of The University Of California System and method for representing and encoding images
JP4701144B2 (en) * 2006-09-26 2011-06-15 富士通株式会社 Image processing apparatus, image processing method, and image processing program

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2258010C2 (en) * 1999-03-31 2005-08-10 Сейко Эпсон Корпорейшн Printing system, printing controller, printer, method for control of printing operation, method for printing, inn cartridge, ink source and ink carrier
RU2323462C2 (en) * 2003-05-14 2008-04-27 Кэнон Кабусики Кайся Image forming device, a cartridge and a storage device mounted in the cartridge
RU2298293C2 (en) * 2004-06-04 2007-04-27 Корпорация "Самсунг Электроникс" System and method for correction of image during output to printing device
RU2337009C2 (en) * 2004-07-06 2008-10-27 Кэнон Кабусики Кайся Method of data processing, device of data processing, method of mask generation and mask template
US20060082825A1 (en) * 2004-10-19 2006-04-20 Samsung Electronics Co., Ltd. Print-data processing apparatus for processing print-data to print in correspondence with print-mode set on connected printing device and method thereof
US20090290883A1 (en) * 2008-05-23 2009-11-26 Kabushiki Kaisha Toshiba Apparatus and method for adjusting toner consumption
US20100214614A1 (en) * 2009-02-23 2010-08-26 Andrew Rodney Ferlitsch Context-aware printing method and system
RU2405201C1 (en) * 2009-06-16 2010-11-27 Корпорация "САМСУНГ ЭЛЕКТРОНИКС Ко., Лтд." Method and system for reducing ink consumption when printing
US20110019213A1 (en) * 2009-07-23 2011-01-27 Samsung Electronics Co., Ltd. Toner saving method, toner saving system, and image forming apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2541132C1 (en) * 2013-07-26 2015-02-10 Федеральное государственное бюджетное образовательное учреждение высшего профессионального образования "Санкт-Петербургский государственный электротехнический университет "ЛЭТИ" им. В.И. Ульянова (Ленина)" Automatic sketch generation method and system therefor

Also Published As

Publication number Publication date
KR20130032264A (en) 2013-04-01
KR101899033B1 (en) 2018-10-04

Similar Documents

Publication Publication Date Title
EP0862136B1 (en) Vector map planarization and trapping
US7978196B2 (en) Efficient rendering of page descriptions
US8711372B2 (en) Techniques for image segment accumulation in document rendering
EP1962224A2 (en) Applying traps to a printed page specified in a page description language format
US7561303B2 (en) Caching and optimisation of compositing
US8823997B2 (en) Processing of logical page data for a printer
US20100060936A1 (en) Image data processor and image data processing program storage medium
US9384427B2 (en) Systems and methods for optimizing pixel based raster trapping
RU2469399C1 (en) System and method of draft mode printing by means of conversion of pictures into contour sketches
US8432572B2 (en) Systems and methods of trapping for print devices
US10582088B2 (en) Information processing apparatus, method, and storage medium for causing printer driver to generate drawing command
US10395399B2 (en) Method for improving the print quality of graphic elements
US8537425B2 (en) Method for optimizing the search for trapping regions
US8610947B2 (en) Image forming apparatus using logical arithmetic processing and image forming program using logical arithmetic processing
EP2466548A1 (en) Method of processing an object-based image file with content type dependent image processing algorithms
JP4345609B2 (en) Image processing apparatus and program
EP1988490A1 (en) Selective density enhancement of graphical objects
US9036203B2 (en) Print controlling apparatus, image forming apparatus, and method for forming image
JP6512763B2 (en) INFORMATION PROCESSING APPARATUS, INFORMATION PROCESSING METHOD, AND PROGRAM
CN110869945A (en) Image processing apparatus
EP3382607B1 (en) System and method for preventing printed material spreading
US20120200896A1 (en) Method for Optimizing the Search for Trapping Regions
JP6821926B2 (en) Drawing data creation device
JP2009066926A (en) Image processing device and image forming system
JP3968989B2 (en) Image processing apparatus, image processing method, and storage medium storing image processing program

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