A layout optimization method during the typesetting process

By integrating the tone coordination between illustrations and text and the edge flatness adjustment method in the layout software, the problem of insufficient overall layout and tone coordination between illustrations and text in the prior art is solved, and the aesthetics and reading appeal of books are improved.

CN116309959BActive Publication Date: 2025-06-20ANHUI VOCATIONAL COLLEGE OF PRESS & PUBLISHING
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310290164.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-23
Publication Date
2025-06-20
Estimated Expiration
2043-03-23

AI Technical Summary

Technical Problem

The existing typesetting software has shortcomings in dealing with the overall layout and tone of illustrations and text, which has failed to effectively improve the overall aesthetics and reading appeal of books.

Method used

By determining the overall tone coordination of illustrations and text, adjusting the edge flatness of illustrations and text, automatically matching the colors of illustrations and text, and optimizing the overall layout of the book.

Benefits of technology

The overall layout of illustrations and text is realized, which improves the aesthetics and reading appeal of books, especially for children's books, which enhances popularity and attention and increases sales.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116309959B_ABST
    Figure CN116309959B_ABST
Patent Text Reader

Abstract

The present invention discloses a layout optimization method during the typesetting process, which relates to the field of press and publication. The method includes: determining the number of chapters included in the book to be edited and the number of illustrations included in each chapter; reading all the illustration data included in the book to be edited; determining the text to be inserted in each illustration and the text outside the illustration; for any one chapter, determining the color of the text outside the illustration and the background color within the chapter based on the average RGB value of all the illustrations within the chapter; for each illustration within each chapter, determining the corresponding caption within the illustration and the insertion position of the caption within the illustration; performing the initial typesetting of the text; establishing a correspondence relationship between the illustrations and the caption paragraphs, and reserving a rectangular blank area matching the size of the illustrations; for each chapter, adjusting the positions of the illustrations within the chapter so that the edge flatness of the text on the sides of all the illustrations within the chapter reaches the maximum value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of printing and typesetting, and particularly to a method for optimizing the layout during the process of book and news publication. Background Art

[0002] Books and newspapers are channels for people to acquire knowledge, effective ways to improve people's qualities, and cradles for cultivating tranquility. Therefore, the development of the publishing industry is one of the symbols of human progress. Publications can transmit ideological and cultural information to readers and be accumulated as the cultural heritage of mankind for long-term preservation.

[0003] With the rise of information dissemination channels such as short videos and self-media, books with a pure text nature are becoming less and less attractive to teenagers and children. In order to increase people's, especially teenagers', reading willingness, more and more illustrations are often added to books.

[0004] Existing typesetting software has been relatively developed. For example, Adobe InDesign and CorelDRAW. However, on the one hand, these software are all developed by foreign companies, and there are few software developed by domestic companies. On the other hand, during the typesetting process, these software are mainly Chinese versions developed based on foreign languages and mainly based on rigid parameters such as character spacing, font, and page margin for typesetting.

[0005] The existing typesetting method does not consider that illustrations and text should be typeset as a whole and the selection of tones. If the positional relationship between the edge contour of the text and the illustrations can be considered as a whole and the colors of the illustrations and the text can be automatically matched and coordinated, the overall typesetting of the book will look more comfortable and coordinated, enabling the content that needs to be concerned to receive more attention, which is helpful for the popularity and attention of books, especially children's books, and can increase sales. Summary of the Invention

[0006] The purpose of the present invention is to provide a method for optimizing the overall layout during the typesetting process.

[0007] Specifically, the present invention provides a method for optimizing the layout during the typesetting process, characterized in that the method comprises the following steps:

[0008] (1) Determine the number of chapters included in the book to be edited and the number of illustrations included in each chapter;

[0009] (2) Read all the illustration image data included in the book to be edited;

[0010] (3) Determine the text to be inserted in each illustration;

[0011] (4) For any chapter, determine the average RGB value of all the illustrations within the chapter, and based on the average RGB value of all the illustrations within the chapter, determine the foreign text color and / or background color of the illustrations within the chapter;

[0012] (5) Determine the text font type, font size, line spacing of the book, and page margins of the book to be edited. For each chapter, perform separate editing, retrieve the main text in the corresponding chapter, and perform the initial typesetting of the text;

[0013] (6) For each chapter, determine the illustration-containing pages and the caption paragraphs corresponding to the illustrations in the chapter. Moreover, establish the correspondence between the illustrations and the caption paragraphs. On the text page corresponding to the illustration, reserve a rectangular blank area that matches the size of the illustration on the side of the paragraph associated with the illustration;

[0014] (7) For each chapter, perform iterative editing on the illustration-containing pages in the chapter from front to back, and determine the sum of the flatness of the edges of the text and symbols on the side of each illustration in the chapter where J represents the total number of pictures in the chapter, j represents the current picture number, H' represents the number of lines of the text corresponding to the picture, h represents the current line of the text corresponding to the picture, and E jh represents the flatness of the edge of the h-th line of text opposite to the side of the j-th picture. For each chapter, adjust the position of the illustrations in the chapter so that the flatness of the edges of the text on the sides of all the illustrations in the chapter reaches the maximum value.

[0015] Furthermore, the method further includes, for each illustration within each chapter, determining the corresponding caption within the illustration and the insertion position of the caption within the illustration; and the foreign text outside the illustration includes the caption outside the illustration and other non-illustration captions.

[0016] Furthermore, the step (4) includes determining the background color of the target chapter such that the difference between the RGB value of the background color and the average RGB value of the illustrations within the chapter is greater than a first threshold, and the difference between the RGB value of the foreign text color outside the illustration and the RGB value of the background color is greater than a second threshold.

[0017] It should be noted that the difference in RGB values mentioned in this article refers to taking the difference of R, G, and B respectively, taking the absolute value, and then performing summation. For example, if the first threshold of the RGB difference is set to 120, then |R1 - R2| + |G1 - G2| + |B1 - B2| needs to be greater than or equal to this threshold, which is set considering the trichromaticity of colors.

[0018] Further, step (5) further includes determining whether each illustration contains caption text within the figure. If it does, calculate the size required for the caption text within the figure according to the current chapter's body text font, and perform a windowing calculation in the figure based on this size. Determine the region with the smallest average pixel variance within the window as the insertion region for the caption text within the figure.

[0019] Further, during the initial typesetting process, the headings and body text in the chapter are typeset from front to back according to a preset format.

[0020] Further, in step (7), the width of the rectangular region is set as w = N*w1+(N - 1)*w2, where w1 represents the width occupied by each character in the current body text font, and w2 represents the width of the interval between every two characters in the current body text font. The height of the rectangle is set as H = M*h1+(M - 1)*h2, and the upper edge of the blank region of the rectangle is aligned with the upper edge of the top row of the caption paragraph on its side.

[0021] Further, step (8) includes: for each chapter, from front to back, for the illustrations in the chapter, adjust the position of the illustration up or down line by line on the side of the text corresponding to the illustration. When initially determining the position of the illustration, insert the illustration on the right side of the paragraph of its corresponding text description, with its upper edge aligned with the topmost line of the text. Determine the flatness value of the text on the right side of the current illustration. Then, adjust it down one line, that is, move the entire illustration down by the distance of one line of text and one line spacing. The vacant position on the right side of the upper line will be filled by the front part of the text in the next line, and the text will be shifted as a whole. According to the method described in step (8), recalculate the sum of the flatness of the text and symbol edges on the side of each picture. Compare the flatness after each adjustment, and determine the illustration arrangement with the largest sum of adjusted flatness for the currently adjusted image as the insertion arrangement for this image. Make a similar adjustment to the next image until all images have been adjusted and compared. Determine the insertion arrangement with the largest sum of adjusted flatness for all images as the optimal insertion arrangement.

[0022] Technical Effects

[0023] The present invention typesets the illustrations and text as a whole and selects the color tone, such that the color difference between the overall color tone within the book chapter and the overall color tone of the accompanying illustrations meets the preset requirements. Additionally, by adjusting the layout with the position relationship between the edge contour of the text and the illustrations as a whole, the boundary contour of the text and images becomes smoother. The present invention automatically matches and coordinates the colors of the illustrations and the text, which can avoid excessive or too small color differences between the illustrations and the text, enabling the content that needs attention to receive more attention, contributing to the popularity and attention of books, especially children's books, and increasing sales. Brief Description of the Drawings

[0024] Figure 1 It is a schematic flowchart of the layout optimization method in the typesetting process in Embodiment 1.

[0025] Figures 2-3 It is a demonstration diagram of the layout optimization method in the typesetting example process. Detailed implementation manners

[0026] The present invention will be described below with reference to specific embodiments. Those skilled in the art can understand that these embodiments are only used to illustrate the present invention and do not limit the scope of the present invention in any way.

[0027] Embodiment 1

[0028] As Figure 1 shown, the overall layout optimization method in the typesetting process in this embodiment includes the following steps:

[0029] (1) Determine the number of chapters included in the book to be edited and the number of illustrations included in each chapter.

[0030] (2) Read all the illustration data included in the book to be edited. For the illustration data corresponding to each illustration, retrieve the RGB values of all the pixels included in the illustration, and calculate the average RGB value of all the pixel data of each illustration.

[0031] (3) Determine the text to be inserted in each illustration, and determine the color value (RGB value) of the text in the illustration based on the average RGB value of all the pixel data of each illustration, so that the difference between the two exceeds a certain threshold.

[0032] (4) For any chapter, determine the average RGB value of all the illustrations in the chapter, and determine the text color outside the illustrations and the background color in the chapter based on the average RGB value of all the illustrations in the chapter, so that the sum of the absolute values of the differences between the RGB value of the background color and the average RGB value of the illustrations is greater than a first predetermined value. For example, taking the RGB values all within the range of 0 - 255 as an example, the threshold is set to be greater than 120, and the sum of the absolute values of the differences between the RGB value of the text color outside the illustrations and the background color and the RGB value of the illustrations is a second threshold, for example, the second threshold is 100.

[0033] Preferably, each chapter adopts a different background color or each chapter adopts a different margin color, which is more convenient for readers to distinguish different chapters.

[0034] (5) Determine the corresponding caption within the illustration and the insertion position of the caption within the illustration. When there is a caption within the illustration, preferably, insert the caption in the area with the smallest variance of the average gray value of the illustration.

[0035] (6) Determine the text font type, font size, line spacing of the book, and page margins to be edited. For each chapter, perform separate editing, retrieve the main text in the corresponding chapter, and perform the initial typesetting of the text. During the initial typesetting process, typeset the headings and main text in each chapter in sequence from front to back according to the preset format. Preferably, for each chapter, the main text uses the same text font and font size.

[0036] (7) For each chapter, determine the pages with illustrations and the corresponding caption paragraphs outside the illustrations in that chapter. Moreover, establish the correspondence between the illustrations and the caption paragraphs. On the main text page corresponding to the illustration, reserve a rectangular blank area matching the size of the illustration on the side of the paragraph associated with the illustration. The width of the rectangular area is set as w = N * w1+(N - 1) * w2, where w1 represents the occupancy width of each character in the current text font, w2 represents the interval width between every two characters in the current text font, and the height of the rectangle is set as H = M * h1+(M - 1) * h2.

[0037] (8) For each chapter, perform iterative editing on the pages with attached drawings in the chapter from front to back, and determine the sum of the flatness of the text and symbol edges on the side of each picture in that chapter. Among them, J represents the total number of pictures in the chapter, j represents the current picture number, H' represents the number of columns of the text corresponding to the picture, h represents the current column of the text corresponding to the picture, and E jh represents the flatness of the edge of the h-th column of text opposite to the side of the j-th picture.

[0038] Establish different flatness correspondence tables for texts with different structures respectively.

[0039] For example, taking the illustration located on the right side of the text as an example, for the flatness of the text edge, use whether the right edge of the text contains a straight radical and the number of protruding strokes included in the right edge as the benchmark for flatness division, and different flatness values can be set for different texts. Set the characters with vertical strokes such as "vertical" and "vertical hook" on the right side as the first level, set the characters with some flat strokes on the right side but with some non-certificate parts as the second level, set the characters with less than 10 strokes and no flat strokes on the right side as the third level, and set the characters with 10 or more strokes and no certificate strokes on the right edge as the fourth level, and set different flatness values for each level. Similarly, for the case where the illustration is located on the left side of the text, set different flatness levels and flatness values for the texts with different left-edge radicals respectively.

[0040]

[0041] (9) For each chapter, from front to back, for the illustrations in the chapter, adjust the position of the illustrations column by column upward or downward on the side of the text corresponding to the illustration. Taking the example of from top to bottom, when initially determining the position of the illustration, insert the illustration to the right of the paragraph of its corresponding text description, align its upper edge with the topmost line of the text, determine the flatness value of the text on the right side of the current illustration, and then adjust it downward by one line, that is, move the whole illustration downward by the distance of one line of text and one line spacing. In this way, the vacant position on the right side of the upper line will be filled by the front part of the text in the lower line, the text will be shifted as a whole, and almost all the text at the corresponding position of the illustration will change. According to the method described in step (8), recalculate the sum of the flatness of the text and symbol edges on the side of each picture Compare the flatness after each adjustment, determine the illustration arrangement method with the largest sum of the adjusted flatness for the currently adjusted image as the insertion method of this image, make a similar adjustment to the next image until all images are adjusted and compared, and determine the best insertion method after all images are adjusted. At this time, the sum of the overall flatness is the largest.

[0042] Example

[0043] As Figure 2 shown is the typesetting process of the illustrations in "The Foolish Old Man Removes the Mountains". Figure 2 Among them, the sum of the flatness values of the text on the right side of the illustration. Here, for the sake of simplicity of description, only consider the flatness of one picture, E = 0.5 + 0.3 + 0.7 + 1 + 0.5 + 0.3 + 0.7 + 1 + 0.7 + 0.5 = 6.2.

[0044] As Figure 3 shown, move the picture downward by one grid. The flatness of the text on the left side of the picture, E = 0.5 + 0.3 + 0.3 + 1 + 0.7 + 0.3 + 0.5 + 0.5 + 0.5 + 1 = 5.6. Therefore, from the perspective of the largest flatness value, Figure 2 the typesetting method in Figure 3 is better than the typesetting method in

[0045] Continue to move the picture downward by one cell position within the reasonable position range of the picture until the typesetting method with the optimal flatness is determined.

[0046] The method of the present invention can be implemented as a separately running program or as a plug-in and embedded into the existing typesetting software for implementation.

[0047] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. It should be understood that the present invention is not limited to the form disclosed herein and should not be regarded as excluding other embodiments. Those skilled in the art can modify the technical solutions described in the foregoing embodiments, or make various changes or deformations according to the present invention, or make equivalent replacements for some of the technical features, as long as they do not depart from the spirit of the present invention, they shall fall within the protection scope of the appended claims of the present invention.

Claims

1. A layout optimization method during typesetting, characterized in that, The method includes the following steps: (1) Determine the number of chapters included in the book to be edited and the number of illustrations included in each chapter; (2) Read all the illustration image data included in the book to be edited; (3) Determine the text to be inserted in each illustration; (4) For any chapter, determine the average RGB value of all the illustrations in the chapter, and based on the average RGB value of all the illustrations in the chapter, determine the text color outside the illustrations and / or the background color within the chapter; (5) Determine the text font type, font size, line spacing of the book, and page margins of the book to be edited. For each chapter, perform separate editing, retrieve the main text in the corresponding chapter, and perform the initial typesetting of the text; (6) For each chapter, determine the pages with illustrations and the corresponding caption paragraphs outside the illustrations in the chapter. Moreover, establish the correspondence between the illustrations and the caption paragraphs. On the main text page corresponding to the illustration, reserve a rectangular blank area that matches the size of the illustration on the side of the paragraph associated with the illustration; (7) For each chapter, iteratively edit the pages with illustrations in the chapter from front to back, and determine the sum of the flatness of the text and symbol edges on the side of each illustration in the chapter. , where J represents the total number of pictures in the chapter, j represents the current picture number, represents the number of lines of text corresponding to the picture, h represents the current line of text corresponding to the picture, and E jh represents the flatness of the edge of the h-th line of text opposite to the side of the j-th picture. For each chapter, adjust the positions of the illustrations in the chapter so that the flatness of the edges of the text on the sides of all illustrations in the chapter reaches the maximum value.

2. The method according to claim 1, characterized in that, The method further includes, for each illustration within each chapter, determining the corresponding caption within the illustration and the insertion position of the caption within the illustration; and the text outside the illustration includes the caption outside the illustration and other non-illustration captions.

3. The method according to claim 1, characterized in that, The step (4) includes determining the background color of the target chapter such that the difference between the RGB value of the background color and the average RGB value of the illustrations in the chapter is greater than a first threshold, and the difference between the RGB value of the text color outside the illustration and the RGB value of the background color is greater than a second threshold.

4. The method according to claim 1, characterized in that, The step (5) further includes determining whether each illustration contains a caption within the figure. If so, calculate the size that the caption within the figure needs to occupy according to the current chapter's main text font, and based on this size, perform a windowing calculation in the figure to determine the area with the smallest average pixel variance within the window as the insertion area for the caption within the figure.

5. The method according to claim 1, characterized in that, During the initial typesetting process, typeset the chapter titles and the main text in the chapter in sequence from front to back according to a preset format.

6. The method according to claim 1, characterized in that, In the step (6), the width of the rectangular area is set as w = N*w1+(N - 1)*w2, where w1 represents the width occupied by each character of the current main text font, w2 represents the width of the interval between every two characters of the current main text font, the height of the rectangle is set as H = M*h1+(M - 1)*h2, and the upper edge of the rectangular blank area is aligned with the upper edge of the top row of the caption paragraph on its side.

7. The method according to claim 1, characterized in that, It further includes step (8), and step (8) includes: for each chapter, from front to back, for the illustrations in the chapter, adjust the position of the illustration line by line upward or downward on the side of the text corresponding to the illustration. When initially determining the position of the illustration, insert the illustration to the right of the paragraph of the text corresponding to it, with its upper edge aligned with the uppermost line of the text. Determine the flatness value of the text on the right side of the current illustration. Then, adjust it downward by one line, that is, move the whole illustration downward by the distance of one line of text and one line spacing. The vacant position on the right side of the upper line will be filled by the front part of the text in the next line, and the text will be shifted as a whole. According to step (7), recalculate the sum of the flatness of the text and the symbol edges on the side of each picture again. Compare the flatness after each adjustment, determine the illustration method with the largest sum of the flatness after adjustment for the currently adjusted image as the insertion method of this image, and make a similar adjustment to the next image until all images are adjusted and compared. Determine the insertion method with the largest sum of the flatness after adjustment of all images as the best insertion method.

Citation Information

Patent Citations

  • Automatic page type setting method

    CN105045776A

  • Picture generation method and device, electronic equipment and computer storage medium

    CN111462280A