The present disclosure relates to an information processing apparatus, a method of controlling an information processing apparatus, and a storage medium.
There has been conventionally known a method in which characters and image data that one likes is printed by using a template in which a layout is determined in advance, and data is applied to the template to produce the layout data. For example, predetermined layout data editing application software is released to implement print layout processing.
In the case where a template is selected during editing of the layout data, the predetermined layout editing application deletes the currently-edited layout data, and applies information on the selected template to layout data to be newly edited.
Accordingly, the user needs to reproduce the contents of editing before the template selection according to the layout of the template applied to the new layout data, and this leads to a decrease in usability. To counter this problem, a method in which the images used by the user are arranged in poster data after the template change according to a predetermined order is generally conceivable.
Moreover, Japanese Patent Laid-Open No. 2022-067587 (hereinafter, referred to as Literature 1) describes a technique in which image data of new translated document and image data of old translated document are associated with each other, and the image data of old translated document is updated all at once based on the information indicating the association.
However, in Literature 1 and the method in which the images used by the user are arranged in the poster data after the template change in a predetermined order, the layout data after the template change sometimes becomes layout data not intended by the user.
In view of the above circumstances, an object of the present disclosure is to improve usability of the layout data editing application.
A storage medium storing a program according to one aspect of the present disclosure is a program which functions in an information processing apparatus and causes the information processing apparatus to function as: an editing unit configured to edit layout data including at least one image slot in which an image is arranged; a reception unit configured to receive an operation of selecting a template including at least one image slot in which an image is arranged, during editing of the layout data; an obtaining unit configured to obtain template information of the selected template; and a determination unit configured to determine an image to be arranged in the image slot included in the selected template, from the image arranged in the currently-edited layout data, based on predetermined information relating to the currently-edited layout data and the template information.
Further features of the present invention will become apparent from the following description of exemplary embodiments with reference to the attached drawings.
Embodiments are explained below in detail with reference to the attached drawings. Note that the following embodiments do not limit the invention according to the scope of claims. Moreover, although multiple characteristics are described in the embodiments, not all of these multiple characteristics are necessarily essential for the invention, and the multiple characteristics can be used in any combination. In the attached drawings, the same or similar configurations are denoted by the same reference numerals, and overlapping explanation is omitted.
An information processing apparatus to which the present embodiment is applied is explained. Although a personal computer (PC) can be given as an example of the information processing apparatus, the information processing apparatus may be any apparatus that can perform display and editing operations of texts and in which a program can operate. The present embodiment can be applied to, for example, a mobile terminal, a laptop computer, a tablet terminal, a personal digital assistant (PDA), and the like.
The CPU 101 controls the entire information processing apparatus 100. The operation unit 102 is an operation unit used by a user to give instructions to the information processing apparatus 100, and includes, for example, a button, a touch panel, or the like. Note that, although
The network interface 103 is an interface for connection with a network. The information processing apparatus 100 is configured to be connectable to the network via the network interface 103 and connectable to the Internet via the network.
The memory 104 is a random-access memory (RAM) that functions as a work area of the CPU 101. The memory 104 is used as a temporary storage area of various pieces of received data, and stores various pieces of setting data.
The display unit 105 is a unit that displays various pieces of information, and is formed a liquid crystal panel or the like. Note that, although
The storage device 106 is, for example, a flash memory or the like, and stores various control programs such as applications and an operating system (hereinafter, referred to as OS) and various pieces information used by these programs.
The input interface 107 is an interface for receiving data inputs and operation instructions from the user. The input interface 107 is formed of, for example, a physical keyboard, buttons, a touch panel, and the like. Note that the input interface 107 and the output interface 108 to be described later may be integrated such that output of images and reception of operations from the user are performed by using common hardware.
The output interface 108 is an interface that performs control for displaying data and presenting information on a status of the information processing apparatus 100 on the external display device or the like. For example, the output interface 108 outputs control information and display target information for displaying information on the external display device. The external display device is configured to include a light emitting diode (LED), a liquid crystal display (LCD), or the like, and displays data or notifies the user of the status of the information processing apparatus 100. Note that the configuration may be such that a software keyboard including keys such as numeral input keys, a mode setting key, a determination key, a cancel key, and a power supply key is displayed on the external display device, and the information processing apparatus 100 receives inputs from the user via the software keyboard.
Next, an example of a flow of a production operation by the poster producing application 202 is explained.
A preview of the poster data 307 is displayed in the poster preview region 301, and the user checks and changes the layout of the poster in the poster preview region 301. The templates 303 with designs varying from one another are displayed in the template selection region 302. Selecting one of the templates 303 causes the selected template to be displayed in the poster preview region. The user can not only create the poster data 307 by selecting a template but can also create a poster from a blank paper by pressing the new poster creation button 306. The images 305 varying from one another are displayed in the image selection region 304. Selecting one of the images 305 adds the selected image to the poster data 307.
In the present embodiment, explanation is given of a method of assigning the images arranged in the poster data to image slots included in the poster data after a template change in the case where the user selects a template during editing of the poster data.
Conventionally, in the case where the template is changed to another template during editing of the poster data, the images to be initially arranged in the image slots in the template after the change are selected from the images arranged in the poster data before the change according to a predetermined order. Accordingly, the arrangement is sometimes different from the image arrangement intended by the user, and the user has to execute an operation of performing image arrangement multiple times including image arrangement to the poster data before the change.
Accordingly, explanation is given below of a method of performing control for bringing the arrangement of the initially-arranged images in the template after the change closer to the arrangement intended by the user.
Next, the present embodiment is explained by using the flowchart of
The CPU 101 of the information processing apparatus 100 implements the processes of the present flowchart by loading and executing the program corresponding to the poster producing application 202 stored in the memory 104 or the storage device 106. Moreover, the processes of the present flowchart are started in the case where the user selects an arbitrary template 303 from the template selection region 302 while editing the poster data. Hereinafter, explanation is given assuming that a subject of the flowchart is the poster producing application 202 controlled by the CPU 101 of the information processing apparatus 100. Note that the symbol “S” in the explanation of each process of the present flowchart means step in the flowchart, and the same applies to the drawings described hereinafter.
In S701, the poster producing application 202 obtains template information of the template 303 selected from the template selection region 302 by the user. The template information is information on the images set by default, the shapes of the image slots, or the like in the template. The template information may be saved in advance in the storage device 106 or obtained from an external server through the network interface 103. In the case where n images are to be arranged in m image slots included in the template, there are nPm possible image arrangement patterns. In this case, n≥m. In the case where n<m, n image slots are selected from the m image slots, and the n images are arranged in the selected image slots without duplication. Accordingly, there are mPn possible image arrangement patterns.
In S702, the poster producing application 202 selects one image arrangement pattern from the above-mentioned possible image arrangement patterns. In this case, a condition of the image arrangement pattern to be selected by the poster producing application 202 is such that an image arrangement pattern for which an evaluation value is not obtained is selected. The evaluation value of the image arrangement pattern is a value obtained in S703 to be described later. It can be determined such that the lower the evaluation value of the image arrangement pattern is, the higher the similarity with the default image arrangement pattern after the change is. Performing image arrangement assumed to have high similarly can increase a possibility that the images desired by the user are arranged at desired positions from the edit start stage.
In S703, the poster producing application 202 calculates the evaluation value for the image arrangement pattern selected in S702. A method of calculating the evaluation value is described later. In S704, the poster producing application 202 determines whether the evaluation values are obtained for all possible image arrangement patterns.
In S704, the poster producing application 202 determines whether the evaluation values are obtained for all image arrangement patterns. In the case where the poster producing application 202 determines that the evaluation values of all image arrangement patterns are obtained, the poster producing application 202 proceeds to S705. Meanwhile, in the case where the poster producing application 202 determines that not all evaluation values are obtained, the poster producing application 202 returns to S702.
In S705, the poster producing application 202 selects the image arrangement pattern that takes the smallest evaluation value among the evaluation values obtained in S702 to S704, as the image arrangement pattern after the change. In S706, the poster producing application 202 develops the information on the template obtained in S701 on the poster data. Specifically, the poster producing application 202 changes the current template in the poster data to the template 303 selected by the user in S701. In S707, the poster producing application 202 performs a process of replacing the images based on the image arrangement pattern selected in S705, on the poster data after the template change. Specifically, the poster producing application 202 determines (specifies) the images to be arranged in the image slots included in the selected template, from the images arranged in the currently-edited layout data. After completion of S707, the poster producing application 202 terminates the process of the present flowchart.
Note that, although the present embodiment is explained assuming that the poster data is being edited, a method in which the user starts editing of the poster data is not limited. A typical editing method of the poster data includes a method of selecting the template 303 from the template selection region 302 and replacing the images in the image slot 401 included in the template. Moreover, an automatic design function in which multiple layouts are generated from the text or the image designated by the user may be used. The automatic design function is a function of performing a process of fitting the text or the image designated by the user to each template and presenting layouts that are attractive to the user. Moreover, although the user arranges the desired images to the image slots existing in the template in the editing method of the poster data described above, the user may add an arbitrary image. In this case, the idea of the replaced image arrangement pattern is not affected as long as n=t+s is satisfied, where t is the number of existing image slots included in the selected template in creation of the poster data, and s is the number of images added by the user.
In the present embodiment, the evaluation value C of each image arrangement pattern is calculated based on the following formula (1) that is a cost function.
In the formula (1), w1 to w3 are coefficients for adjusting weights of the respective terms.
S1 is a sum of differences in hue histogram between the images used by the user before the template change and the images used after the template change (images arranged by default in the template selected by the user), and is calculated by the following formula (2).
In the case where the images used in the poster data before the template change are referred to as used image group, hu s e d, i ,j is a histogram value of a hue j in an i-th image of the used image group. Moreover, ht e m p l a t e, i ,j is a histogram value of a hue j in an image used by default in an image slot to which the i-th image of the used image group is assigned after the template change.
Considering S1 enables evaluation of how much a shade of color of a target image arrangement pattern is similar to a shade of color of image arrangement in the selected template.
S2 is a sum of differences in aspect ratios between the images (images used by the user before the template change) included in the used image group and the shapes of the image slots included in the template selected by the user, and is calculated by the following formula (3).
In the formula (3), ru s e d ,i is a value of the aspect ratio in the i-th image of the used image group. Moreover, rt e m p l a t e ,i is an aspect ratio of the image slot to which the i-th image of the used image group is assigned after the template change.
Considering S2 enables evaluation of how much the original images can be displayed without cropping in the target image arrangement pattern.
S3 is a sum of differences between the shapes of the image slots included in the poster data before the template change and the shapes of the image slots included in the poster data after the template change, and is calculated by the following formula.
In the formula (4), rb e f o r e, i and sb e f o r e, i are, respectively, values of the aspect ratio and the size of the image slot to which the i-th image of the used image group is assigned in the poster data before the template change.
In the formula (4), ra f t e r, i and sa f t e r ,i are, respectively, values of the aspect ratio and the size of the image slot to which the i-th image of the used image group is assigned in the poster data after the template change.
Considering S3 enables evaluation of how much the shapes of the image slots to which the images are assigned in the target image arrangement pattern are similar to the shapes of the image slots in the poster data before the template change.
Note that, although the evaluation value is obtained by calculation of the above-mentioned cost functions in the present embodiment, for example, the evaluation value may be obtained by AI or the like using deep learning, or obtained by using functions other than the above-mentioned cost functions. Moreover, the above-mentioned evaluation value may be determined from one of the values of S1 to S3, or determined from, for example, two terms with S1 to S3.
As described above, according to the present embodiment, the usability in the layout data editing application can be improved. Specifically, it is possible to apply the image arrangement considering the intention of the user in the image arrangement originally performed by the user to the poster data after the template change while maintaining design properties of the template. Accordingly, the image arrangement of the poster data after the template change is more likely to be attractive to the user, and the user operation of adjusting display of the images can be reduced. Thus, changing of the template in a state where arbitrary images are arranged can be facilitated.
In the present embodiment, explanation is given of a method of improving operability by allowing the user to select the image arrangement to be applied to the poster data after the template change.
The present embodiment is explained by using the flowchart of
In S905, the poster producing application 202 selects the image arrangement patterns to be image arrangement pattern candidates in the possible image arrangement patterns, based on the evaluation values obtained in S902 to S904. A method of selecting the image arrangement pattern candidates is, for example, selection in a method in which a predetermined number of image arrangement pattern candidates are sequentially selected in the ascending order of evaluation value. Moreover, as another form, a method in which a predetermined value is determined as a threshold and the image arrangement patterns with the evaluation value equal to or smaller than the determined threshold are selected may be adopted.
In S906, the poster producing application 202 displays the poster data to which the image arrangement patterns selected as the image arrangement pattern candidates are applied, on the image arrangement selection screen. Specifically, the screen illustrated in
In S907, the poster producing application 202 receives selection of one image arrangement pattern from the displayed image arrangement pattern candidates by the user.
In S908, the poster producing application 202 holds the image arrangement pattern selected by the user as the image arrangement pattern after the change. Note that, in the case where the user presses the no-image-replacement button 804 in the image arrangement selection screen displayed in S906, the image arrangement pattern with the smallest evaluation value is held as the image arrangement pattern after the change. Since processes equivalent to the processes of S706 to S707 in
According to the present embodiment, the image arrangement pattern further matching the intention of the user can be applied to the poster data after the template change. This can reduce the user operation of adjusting the display of images, and improve the operability for the user.
Although the case where the poster data is produced and edited is explained above, the embodiments can be applied also to the case where layout data other than the poster data is produced and edited.
Embodiment(s) of the present invention can also be realized by a computer of a system or apparatus that reads out and executes computer executable instructions (e.g., one or more programs) recorded on a storage medium (which may also be referred to more fully as a ‘non-transitory computer-readable storage medium’) to perform the functions of one or more of the above-described embodiment(s) and/or that includes one or more circuits (e.g., application specific integrated circuit (ASIC)) for performing the functions of one or more of the above-described embodiment(s), and by a method performed by the computer of the system or apparatus by, for example, reading out and executing the computer executable instructions from the storage medium to perform the functions of one or more of the above-described embodiment(s) and/or controlling the one or more circuits to perform the functions of one or more of the above-described embodiment(s). The computer may comprise one or more processors (e.g., central processing unit (CPU), micro processing unit (MPU)) and may include a network of separate computers or separate processors to read out and execute the computer executable instructions. The computer executable instructions may be provided to the computer, for example, from a network or the storage medium. The storage medium may include, for example, one or more of a hard disk, a random-access memory (RAM), a read only memory (ROM), a storage of distributed computing systems, an optical disk (such as a compact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, a memory card, and the like.
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
This application claims the benefit of Japanese Patent Application No. 2023-136358, filed Aug. 24, 2023, which is hereby incorporated by reference wherein in its entirety.
| Number | Date | Country | Kind |
|---|---|---|---|
| 2023-136358 | Aug 2023 | JP | national |