Image carousel display method and device based on circular arrangement

By preprocessing and layout control of images, combined with CSS animation and JavaScript, the compatibility, performance and user interaction issues of circularly arranged image carousels are solved, and an efficient, responsive and compatible image carousel effect is achieved, improving Improve user experience and code maintainability.

CN118502863BActive Publication Date: 2024-09-20ONE NETWORK INTEROPERABILITY (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410916780.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-09-20
Estimated Expiration
2044-07-10

AI Technical Summary

Technical Problem

In the existing technology, circularly arranged image carousels have compatibility issues, performance issues, responsive design issues, user interaction issues, maintenance and scalability issues, SEO and accessibility issues, and development difficulties in different browsers. High, resulting in poor performance and poor user experience.

Method used

By obtaining the original image collection for preprocessing, we design image processing parameter vectors and layout control vectors, use CSS animation and JavaScript to achieve circular arrangement and smooth transition of images, combine lazy loading and media queries, optimize image loading and adaptation, and improve user experience. Interactive experience and ensure SEO and compatibility.

Benefits of technology

It achieves high-performance, responsive and compatible image carousel effects on different devices and browsers, improves user experience and code maintainability, and ensures SEO and accessibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118502863B
    Figure CN118502863B
Patent Text Reader

Abstract

In the embodiment of the present invention, a method, device and electronic device for displaying a carousel of images based on a circular arrangement are provided, which belongs to the field of image processing technology. The method includes: setting an image processing parameter vector K for an original image set P, so as to perform image preprocessing on the original image set P based on the image processing parameter vector K to obtain a carousel image set PL; designing a layout control vector Ks for the carousel image set PL; applying a transform attribute to each image in the carousel image set PL, calculating the x and y coordinates according to the image index and the radius of the circle, so that the images are arranged on the circumference; adjusting the size and arrangement of the image according to different screen sizes, and matching the display effect of the carousel image on different devices. This solution can improve the loading efficiency of the carousel image and its compatibility in different usage scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method, device and electronic device for displaying a circularly arranged image carousel. Background Art

[0002] The circular arrangement of images in a carousel is different from the traditional horizontal or vertical sliding carousel display. In this layout, the images are not arranged linearly, but in a circular or ring-shaped manner, creating a unique visual effect. This effect is usually achieved through CSS3 transformations (such as rotate and translate) combined with JavaScript or a specific carousel plug-in, making the image look like it is rotating around a center point.

[0003] In a circular carousel, users can click a button or autoplay to cycle through the images. The images will simulate the movement of a circular track when switching. Some implementations will keep the center image larger while the surrounding images gradually shrink, creating a 3D sense of depth or a circular scrolling effect on a flat surface. This effect is common in some web designs, especially those websites or applications that want to attract users through unusual visual effects.

[0004] The existing technology has the following main problems:

[0005] 1. Compatibility issues:

[0006] Different browsers have different levels of support for CSS3 and HTML5, which may cause inconsistent performance of the carousel effect in different browsers.

[0007] 2. Performance issues:

[0008] When there are a large number of images or the image size is large, it will affect the loading speed and page performance, especially on mobile devices. The animation effects may take up a lot of computing resources, causing the page to freeze or drop frames.

[0009] 3. Responsive Design:

[0010] The circularly arranged pictures need to be adapted to different screen sizes and must be displayed well on both small and large screens. To this end, the problems of picture scaling and arrangement need to be handled to ensure that the pictures are not distorted and are arranged compactly.

[0011] 4. User Interaction:

[0012] Users want to be able to easily click and slide pictures to browse, so touch events and mouse events need to be handled properly. To this end, the duration and effect of the animation need to be adjusted appropriately to ensure that the user experience is not abrupt.

[0013] 5. Maintenance and scalability:

[0014] The maintainability and scalability of the code need to be considered to avoid difficulties in modification due to changing requirements. If you need to load images or content dynamically, you need to handle various problems in the loading process, such as lazy loading, image caching, etc.

[0015] 6. SEO and Accessibility:

[0016] Make sure your image carousel is search engine friendly and avoid using too much JavaScript that can affect SEO.

[0017] 7. Development Difficulty:

[0018] The layout and animation of circular arrangements are relatively complex, requiring developers to have advanced CSS and JavaScript skills. They may need to use third-party libraries or frameworks such as GSAP (GreenSock Animation Platform) to achieve complex animation effects.

[0019] The above problems become technical problems that need to be solved. Summary of the invention

[0020] In view of this, embodiments of the present invention provide a method, device and electronic device for displaying a circularly arranged image carousel, which at least partially solve the problems existing in the prior art.

[0021] In a first aspect, an embodiment of the present invention provides a method for displaying a circularly arranged image carousel, comprising:

[0022] After obtaining n original image sets P to be displayed in a carousel, an image processing parameter vector K for the original image set P is set, so as to perform image preprocessing on the original image set P based on the image processing parameter vector K to obtain a carousel image set PL;

[0023] For the carousel image set PL, a layout control vector Ks=[CS, IS, TI, AD, RD] is designed, where CS represents the selector of the container containing all images, IS represents the image selector array, each element in the image selector array is a string representing the selector of a single image, TI equals n, representing the total number of images participating in the carousel, AD represents the duration of the transition animation, and RD represents the carousel direction;

[0024] Apply the transform attribute to each image in the carousel image set PL, calculate the x and y coordinates based on the image index and the radius of the circle so that the images are arranged on the circumference, initialize rotate to the angle calculated based on the image index so that the images are arranged around the center point, and add the features in the design layout control vector to each image;

[0025] Adjust the size and arrangement of images according to different screen sizes, match the display effect of carousel images on different devices, and dynamically adjust the radius of the circular arrangement and the spacing between images to adapt to different viewport sizes.

[0026] According to a specific implementation of the embodiment of the present disclosure, the method further includes:

[0027] Design a basic HTML structure, including a container element to wrap all images, determine the HTML tags for each image, and ensure that they can be displayed correctly on different devices and screen sizes.

[0028] According to a specific implementation of the embodiment of the present disclosure, the method further includes:

[0029] Write JavaScript code to control the logic of the image carousel, including automatic playback, pause, and manual switching of images. Use JavaScript to handle user interaction events and implement manual switching of images.

[0030] According to a specific implementation of the embodiment of the present disclosure, the method further includes:

[0031] The image is only loaded when it enters the viewport, reducing initial loading time and resource consumption;

[0032] Use Polyfill and browser prefixes to ensure compatibility of CSS3 and HTML5 features in different browsers;

[0033] Add alternative text for each image to improve search engine crawlability and accessibility, and ensure that the image carousel functionality still works when JavaScript is disabled.

[0034] According to a specific implementation of the embodiment of the present disclosure, the image preprocessing is performed on the original image set P based on the image processing parameter vector K to obtain the carousel image set PL, including:

[0035] Based on the image processing parameter vector K, the brightness value s of the image is modified by equalization:

[0036] s = cdf (I) / ((L-1)) × L

[0037] s is the brightness value of the equalized pixel, I is the original pixel brightness value, cdf(I) is the cumulative distribution function of I, and L is the brightness level of the image contained in the image processing parameter vector K;

[0038] Increase or decrease the overall brightness of the image based on the image processing parameter vector K:

[0039] I'(x,y)=I(x,y)+Kl

[0040] I'(x,y) is the adjusted pixel value, I(x,y) is the original pixel value, and Kl is the brightness adjustment parameter contained in the image processing parameter vector K;

[0041] Based on the image processing parameter vector K, change the contrast of the image:

[0042] I'(x,y)=Kz⋅(I(x,y)-μ)+μ

[0043] μ is the average brightness value of the image, and Kz is the contrast enhancement factor contained in the image processing parameter vector K.

[0044] In a second aspect, an embodiment of the present invention provides an image carousel display device based on a circular arrangement, comprising:

[0045] A setting module, after acquiring n original image sets P to be displayed in a carousel, sets an image processing parameter vector K for the original image set P, so as to perform image preprocessing on the original image set P based on the image processing parameter vector K to obtain a carousel image set PL;

[0046] The control module designs a layout control vector Ks=[CS, IS, TI, AD, RD] for the carousel image set PL, where CS represents the selector of the container containing all images, IS represents the image selector array, each element in the image selector array is a string representing the selector of a single image, TI equals n, representing the total number of images participating in the carousel, AD represents the duration of the transition animation, and RD represents the carousel direction;

[0047] The layout module applies the transform attribute to each image in the carousel image set PL, calculates the x and y coordinates based on the image index and the radius of the circle so that the images are arranged on the circumference, initializes rotate to the angle calculated based on the image index so that the images are arranged around the center point, and adds the features in the design layout control vector to each image;

[0048] The matching module adjusts the size and arrangement of images according to different screen sizes, matches the display effect of the carousel images on different devices, and dynamically adjusts the radius of the circular arrangement and the spacing between images to adapt to different viewport sizes.

[0049] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0050] at least one processor; and,

[0051] a memory communicatively connected to the at least one processor; wherein,

[0052] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the image carousel display method based on circular arrangement in any of the first aspects or any implementation of the first aspect.

[0053] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the image carousel display method based on circular arrangement in the aforementioned first aspect or any implementation of the first aspect.

[0054] In a fifth aspect, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the image carousel display method based on circular arrangement in the aforementioned first aspect or any implementation of the first aspect.

[0055] The circular arrangement-based image carousel display scheme in the embodiment of the present invention includes: after obtaining n original image sets P to be displayed in a carousel, setting an image processing parameter vector K for the original image set P, so as to perform image preprocessing on the original image set P based on the image processing parameter vector K to obtain a carousel image set PL; for the carousel image set PL, designing a layout control vector Ks=[CS, IS, TI, AD, RD], CS represents the selector of the container containing all images, IS represents the image selector array, each element in the image selector array is a string, representing the selector of a single image, TI equals n, representing the total number of images participating in the carousel, AD represents the duration of the transition animation, and RD represents the direction of the carousel; apply the transform attribute to each image in the carousel image set PL, calculate the x and y coordinates according to the image index and the radius of the circle, arrange the images on the circumference, initialize rotate to the angle calculated based on the image index, arrange the images around the center point, and add the features in the design layout control vector to each image; adjust the size and arrangement of the image according to different screen sizes, match the display effect of the carousel image on different devices, and dynamically adjust the radius of the circular arrangement and the spacing of the images to adapt to different viewport sizes. The present invention realizes the circular arrangement and smooth transition of images through CSS animation and transformation technology, and combines JavaScript dynamic operation to process the loading and interaction of images to achieve high-performance and responsive image carousel effects. By optimizing the image loading strategy, lazy loading technology is used to reduce the initial loading time, and media queries are used to ensure good adaptation on different devices. In addition, a modern event handling mechanism is used to improve the user interaction experience, and barrier-free design and SEO optimization are taken into account to ensure the compatibility and accessibility of image carousels in various usage scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0057] Figure 1 A schematic diagram of a flow chart of a method for displaying images in a circular arrangement according to an embodiment of the present invention;

[0058] Figure 2 A schematic flow chart of another method for displaying images in a circular arrangement according to an embodiment of the present invention;

[0059] Figure 3 A schematic diagram of the structure of a circularly arranged image carousel display device provided by an embodiment of the present invention;

[0060] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0061] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0062] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.

[0063] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.

[0064] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0065] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.

[0066] The embodiment of the present disclosure provides a method for displaying a circularly arranged image carousel. The method for displaying a circularly arranged image carousel provided in the embodiment can be executed by a computing device, which can be implemented as software or a combination of software and hardware, and which can be integrated in a server, a terminal device, etc.

[0067] See also Figure 1 and Figure 2 The present disclosure provides a method for displaying a circularly arranged image carousel, including:

[0068] S101, after obtaining n original image sets P to be displayed in a carousel, an image processing parameter vector K is set for the original image set P, so as to perform image preprocessing on the original image set P based on the image processing parameter vector K to obtain a carousel image set PL.

[0069] Specifically, n original images that need to be displayed in a carousel may be obtained. These images are contents that are planned to be displayed in the carousel, such as product images, landscape photos, or other visual contents.

[0070] Directly rotating the original images will cause slow image loading due to reasons such as the large size of the original images. Therefore, an image processing parameter vector K can be defined to pre-process the original images before they are loaded.

[0071] As an example, we can define an image processing parameter vector K that may contain the following elements:

[0072] resize: (width, height) or scale ratio.

[0073] crop: Crop region or target aspect ratio.

[0074] brightness: Brightness adjustment value.

[0075] contrast: Contrast adjustment value.

[0076] color_correction: Color correction configuration.

[0077] compression: Compression level or target file size.

[0078] circular_mask: whether to apply circular clipping and specific parameters.

[0079] You can use a programming language to perform preprocessing operations on each image according to the parameters in the vector K. Write a script or use a software function to batch process these images to ensure that each step is performed precisely as per the parameters.

[0080] As an optional example, the brightness value s of the image can be modified by equalization based on the image processing parameter vector K:

[0081] s = cdf (I) / ((L-1)) × L

[0082] s is the brightness value of the equalized pixel, I is the original pixel brightness value, cdf(I) is the cumulative distribution function of I, and L is the brightness level of the image contained in the image processing parameter vector K;

[0083] Increase or decrease the overall brightness of the image based on the image processing parameter vector K:

[0084] I'(x,y)=I(x,y)+Kl

[0085] I^' (x, y) is the adjusted pixel value, I(x, y) is the original pixel value, and Kl is the brightness adjustment parameter contained in the image processing parameter vector K;

[0086] Based on the image processing parameter vector K, change the contrast of the image:

[0087] I'(x,y)=Kz⋅(I(x,y)-μ)+μ

[0088] μ is the average brightness value of the image, and Kz is the contrast enhancement factor contained in the image processing parameter vector K.

[0089] Furthermore, the image can be subjected to random noise filtering based on the image processing parameter vector K:

[0090]

[0091] G(m,q) is the filter kernel function, m,q are the filter offset parameter values, and σ is the standard deviation of the images in the carousel image set.

[0092] After preprocessing, a new image set PL will be obtained. Each image in this set has been optimized for circular carousel display. These images should be visually consistent, of appropriate size, load quickly, and fit seamlessly into the designed carousel layout.

[0093] S102. Design a layout control vector Ks=[CS, IS, TI, AD, RD] for the carousel image set PL, where CS represents the selector of the container containing all images, IS represents the image selector array, each element in the image selector array is a string representing the selector of a single image, TI is equal to n, representing the total number of images participating in the carousel, AD represents the duration of the transition animation, and RD represents the carousel direction.

[0094] The layout control vector Ks for the carousel image set PL may include the following elements:

[0095] CS, container selector, is used to locate the HTML element that contains all the carousel images. You can use CSS selectors (such as ID, class name, tag, etc.) to identify the container of the carousel. For example, if the container has an ID of carousel-container, CS can be the string "carousel-container".

[0096] IS, an array of image selectors used to locate the individual carousel images within the container. Each image selector is a string, which can be a CSS selector (such as an ID, a class name, etc.). The array IS should contain the selectors of all images participating in the carousel within the container. For example, if the image has the class name carousel-image and has different IDs (such as carousel-image-1, carousel-image-2, etc.), then IS may be ["carousel-image-1", "carousel-image-2",...].

[0097] TI, the total number of images participating in the carousel, is an integer representing the number of elements in the IS array, and also represents the number of images that the carousel needs to traverse.

[0098] AD, the duration of the transition animation, can be a value representing time, which can be seconds (s), milliseconds (ms), etc. For example, if the animation duration is 1 second, AD can be 1000 (milliseconds).

[0099] RD , the direction of the carousel, indicates whether the image scrolls forward (such as from left to right) or backward (such as from right to left). RD can be an enumeration value or a string to indicate the direction of the carousel. For example, you can use the string "forward" to indicate forward scrolling and "backward" to indicate backward scrolling. Alternatively, you can use a number, such as 1 for forward and -1 for backward.

[0100] S103, apply the transform attribute to each image in the carousel image set PL, calculate the x and y coordinates according to the image index and the radius of the circle, arrange the images on the circumference, initialize rotate to the angle calculated based on the image index, arrange the images around the center point, and add the features in the design layout control vector to each image.

[0101] Specifically, the position (x, y) of each image may be calculated. For example, the coordinates of the center point of the carousel image may be set to (cx, cy).

[0102] For each image in the carousel image collection, according to its index i in the collection (starting from 0), calculate its angle angle = 2 * π * i / n on the circumference, where n is the total number of images and π is the circumference of the circle.

[0103] Using the calculated angle, calculate the position where the image should be placed using the formula for converting polar coordinates to rectangular coordinates.

[0104] x = cx + r * cos(angle) , y = cy + r * sin(angle) where r is the radius of the circle.

[0105] The initial rotation angle of the image is calculated based on its index in the collection, and each image will be rotated by an equal angle relative to the previous image, that is, rotate = (360 / n) * i degrees.

[0106] For each image in the PL, construct a CSS transform property value that includes translation (translate(x, y)) and rotation (rotate(degrees)), where x, y are the previously calculated position coordinates and degrees is the calculated rotation angle.

[0107] Through the above steps, the position and rotation angle of each image in the carousel image collection can be dynamically set so that they are arranged along the circumference, and additional layout control features can be integrated as needed.

[0108] S104, adjusting the size and arrangement of the images according to different screen sizes, matching the display effects of the carousel images on different devices, and dynamically adjusting the radius of the circular arrangement and the spacing between the images to adapt to different viewport sizes.

[0109] You can use front-end technologies (such as JavaScript) to obtain the screen size and viewport size of the current device (that is, the size of the browser window). For example, this can be achieved through properties such as window.innerWidth and window.innerHeight.

[0110] Calculate the maximum width and height that the carousel images should have based on the screen size and viewport size. If the images need to maintain a fixed aspect ratio, the height can be calculated based on the screen width. For circular arrangements, the radius can be calculated based on the width and number of images. For example, if there are four images that need to be evenly spaced in a circle, the radius of the circle will be half the image width plus half the image spacing.

[0111] Image spacing can be dynamically adjusted based on screen size and number of images. For example, on a smaller screen, the spacing may need to be reduced to accommodate more images; on a larger screen, the spacing can be increased to provide a better visual experience.

[0112] Use CSS to style and lay out the images. For example, you can use max-width and height: auto to ensure that the image maintains the correct aspect ratio when it is scaled. Use CSS's flexbox, grid, or position properties to achieve circular effects. For circular arrangements, you may need to combine CSS's transform property to rotate and position the image.

[0113] You can write JavaScript code to listen to changes in window size (through the resize event) and dynamically adjust the size, spacing, and arrangement of images. When the window size changes, recalculate the size and spacing of the images, and update the CSS style or DOM structure to achieve the new layout.

[0114] You can use front-end frameworks and libraries such as React, Vue, Angular, etc. to simplify the development process and improve the maintainability of the code. These frameworks and libraries usually provide rich components and tools to handle issues such as image size, spacing, and arrangement.

[0115] Through the above steps, the size and arrangement of images can be dynamically adjusted according to different screen sizes and viewport sizes to achieve adaptation and optimization of carousel images on different devices.

[0116] See also Figure 2 , as another embodiment of the present invention, comprises the following steps:

[0117] S201. Image preparation and optimization: Before implementing the front-end circular image carousel display, first optimize all images. Use image compression and cropping technology to reduce the file size of each image to ensure that the image loads quickly and clearly. Unify the size and resolution of the images to ensure that the images in the carousel display can be seamlessly connected and the visual effect is consistent.

[0118] S202. HTML structure design: Build the basic HTML structure and create a container element that contains all the images. In the container, create corresponding HTML tags for each image (such as or ), make sure these tags are flexible to different devices and screen sizes. Using semantic tags helps with SEO optimization and accessibility.

[0119] S203. CSS layout and animation: Use CSS layout technology to achieve circular arrangement of images. Use the transform property of CSS to set the rotation and positioning of the images so that the images are evenly distributed along the circumference. Specifically, the precise positioning of the images can be achieved through the combination of transform: rotate and transform: translate. In addition, design and implement smooth transition animation effects, such as using transition or animation properties, to ensure that the image switching is natural and smooth during the carousel process, avoiding freezes or flickers.

[0120] S204. JavaScript dynamic operation: Write JavaScript code to control the logic of the image carousel. Implement the autoplay function by setting a timer (such as using setInterval) to switch the displayed images at a fixed time. Users can manually switch images by clicking buttons or touching and sliding. JavaScript monitors these interactive events and updates the image display accordingly. To enhance the user experience, you can add animation effects such as fade in and fade out, smooth scrolling, etc.

[0121] S205. Responsive design: Use CSS media query technology to achieve responsive design of image carousel. Adjust the size and arrangement of images according to the screen size of the device to ensure good display effect on various devices. The radius of the circular arrangement and the spacing of the images can be dynamically adjusted to adapt to different viewport sizes to ensure visual consistency and aesthetics.

[0122] S206. Image lazy loading: To improve the page loading performance, implement image lazy loading technology. By monitoring the scroll event, determine whether the image enters the viewport, and start loading when the image is about to enter the viewport. This not only reduces the initial loading time, but also saves bandwidth and memory resources. You can use the Intersection Observer API to efficiently implement the lazy loading function.

[0123] S207. Browser compatibility: Considering the different browsers’ support for CSS3 and HTML5 features, use Polyfill and browser prefixes to ensure compatibility. Add necessary prefixes (such as -webkit-, -moz-, etc.) to key CSS properties to ensure consistent performance in mainstream browsers. Conduct extensive cross-browser testing to promptly discover and fix compatibility issues in specific browsers.

[0124] S208. SEO and accessibility optimization: Add alternative text (alt text) to each image to improve search engine crawlability and page accessibility. Ensure that the carousel function can still partially operate when JavaScript is disabled, such as providing a static image list display. Use the design concept of progressive enhancement, that is, enable advanced effects in browsers that support advanced features, and provide basic functions in browsers that do not support them.

[0125] S209. Performance optimization: Optimize the calculation of animation and transition effects, reduce the number of reflows and repaints, and improve page performance. Use CSS hardware acceleration technology (such as using transform and opacity attributes) to improve the smoothness and response speed of animation. Minimize the number of DOM operations and use DocumentFragment and virtual DOM technology to improve operation efficiency.

[0126] S210. User interaction optimization: Enhance the user interaction experience, adopt modern event handling mechanisms (such as using addEventListener) to handle user clicks, touch slides and other operations. Provide gesture support so that users can easily switch pictures on mobile devices. Improve the friendliness and intuitiveness of the interaction through appropriate feedback effects (such as visual feedback after button clicks).

[0127] The method for displaying a circularly arranged image carousel on the front end disclosed by the present invention realizes the circular arrangement and smooth transition of images through CSS animation and transformation technology, and combines JavaScript dynamic operations to process the loading and interaction of images, thereby realizing a high-performance and responsive image carousel effect. The solution optimizes the image loading strategy, adopts lazy loading technology to reduce the initial loading time, and uses media queries to ensure good adaptation on different devices. In addition, a modern event handling mechanism is used to improve the user interaction experience, and barrier-free design and SEO optimization are taken into account to ensure the compatibility and accessibility of the image carousel in various usage scenarios. The overall technical solution aims to solve the shortcomings of traditional image carousels in terms of performance, compatibility, responsive design and user interaction, and provide users with a smooth, efficient and compatible circular image carousel display effect.

[0128] According to a specific implementation of the embodiment of the present disclosure, the method further includes:

[0129] Design a basic HTML structure, including a container element to wrap all images, determine the HTML tags for each image, and ensure that they can be displayed correctly on different devices and screen sizes.

[0130] According to a specific implementation of the embodiment of the present disclosure, the method further includes:

[0131] Write JavaScript code to control the logic of the image carousel, including automatic playback, pause, and manual switching of images. Use JavaScript to handle user interaction events and implement manual switching of images.

[0132] According to a specific implementation of the embodiment of the present disclosure, the method further includes:

[0133] The image is only loaded when it enters the viewport, reducing initial loading time and resource consumption;

[0134] Use Polyfill and browser prefixes to ensure compatibility of CSS3 and HTML5 features in different browsers;

[0135] Add alternative text for each image to improve search engine crawlability and accessibility, and ensure that the image carousel functionality still works when JavaScript is disabled.

[0136] According to a specific implementation of the embodiment of the present disclosure, the image preprocessing is performed on the original image set P based on the image processing parameter vector K to obtain the carousel image set PL, including:

[0137] Based on the image processing parameter vector K, the brightness value s of the image is modified by equalization:

[0138] s = cdf (I) / ((L-1)) × L

[0139] s is the brightness value of the equalized pixel, I is the original pixel brightness value, cdf(I) is the cumulative distribution function of I, and L is the brightness level of the image contained in the image processing parameter vector K;

[0140] Increase or decrease the overall brightness of the image based on the image processing parameter vector K:

[0141] I'(x,y)=I(x,y)+Kl

[0142] I'(x,y) is the adjusted pixel value, I(x,y) is the original pixel value, and Kl is the brightness adjustment parameter contained in the image processing parameter vector K;

[0143] Based on the image processing parameter vector K, change the contrast of the image:

[0144] I'(x,y)=Kz⋅(I(x,y)-μ)+μ

[0145] μ is the average brightness value of the image, and Kz is the contrast enhancement factor contained in the image processing parameter vector K.

[0146] According to a specific implementation of the embodiment of the present disclosure, adjusting the size and arrangement of images according to different screen sizes to match the display effects of the carousel images on different devices includes:

[0147] Determine the scaling factor ScaleFactor:

[0148] ScaleFactor=min(ViewportWidth / W base ,1)

[0149] W base Represents the base width value, and ViewportWidth represents the width value of the carousel image window.

[0150] According to a specific implementation of the embodiment of the present disclosure, the adjusting the size and arrangement of the images according to different screen sizes to match the display effects of the carousel images on different devices also includes:

[0151] According to the scaling factor ScaleFactor, calculate the adaptive width value I of the carousel image w and adaptive height value I h :

[0152] I w =I wbase ×ScaleFactor

[0153] I h =I w / I wbase × I hbase

[0154] I wbase Indicates the original base width of the carousel image. hbase Indicates the original base height value of the carousel image.

[0155] Corresponding to the above method embodiment, see Figure 3 The embodiment of the present invention further discloses an image carousel display device 30 based on circular arrangement, comprising:

[0156] The setting module 301, after acquiring n original image sets P to be displayed in a carousel, sets an image processing parameter vector K for the original image set P, so as to perform image preprocessing on the original image set P based on the image processing parameter vector K to obtain a carousel image set PL;

[0157] The control module 302 designs a layout control vector Ks=[CS, IS, TI, AD, RD] for the carousel image set PL, where CS represents the selector of the container containing all images, IS represents the image selector array, each element in the image selector array is a string representing the selector of a single image, TI is equal to n, representing the total number of images participating in the carousel, AD represents the duration of the transition animation, and RD represents the carousel direction;

[0158] The layout module 303 applies the transform attribute to each image in the carousel image set PL, calculates the x and y coordinates according to the image index and the radius of the circle so that the images are arranged on the circumference, initializes rotate to the angle calculated based on the image index so that the images are arranged around the center point, and adds the features in the design layout control vector to each image;

[0159] The matching module 304 adjusts the size and arrangement of the images according to different screen sizes, matches the display effects of the carousel images on different devices, and dynamically adjusts the radius of the circular arrangement and the spacing between the images to adapt to different viewport sizes.

[0160] See also Figure 4 The embodiment of the present invention further provides an electronic device 60, the electronic device comprising:

[0161] at least one processor; and,

[0162] a memory communicatively connected to the at least one processor; wherein,

[0163] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image carousel display method based on circular arrangement in the aforementioned method embodiment.

[0164] An embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the aforementioned method embodiment.

[0165] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the image carousel display method based on circular arrangement in the aforementioned method embodiment.

[0166] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device 60 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0167] like Figure 4 As shown, the electronic device 60 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 60 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0168] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 60 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 60 is shown with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.

[0169] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0170] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for displaying a circularly arranged image carousel, characterized in that: include: After obtaining n original image sets P to be displayed in a carousel, an image processing parameter vector K for the original image set P is set, so as to perform image preprocessing on the original image set P based on the image processing parameter vector K to obtain a carousel image set PL; For the carousel image set PL, a layout control vector Ks=[CS, IS, TI, AD, RD] is designed, where CS represents the selector of the container containing all images, IS represents the image selector array, each element in the image selector array is a string representing the selector of a single image, TI equals n, representing the total number of images participating in the carousel, AD represents the duration of the transition animation, and RD represents the carousel direction; Apply the transform attribute to each image in the carousel image set PL, calculate the x and y coordinates based on the image index and the radius of the circle so that the images are arranged on the circumference, initialize rotate to the angle calculated based on the image index so that the images are arranged around the center point, and add the features in the design layout control vector to each image; Adjust the size and arrangement of images according to different screen sizes, match the display effect of carousel images on different devices, and dynamically adjust the radius of the circular arrangement and the spacing between images to adapt to different viewport sizes; The performing image preprocessing on the original image set P based on the image processing parameter vector K to obtain the carousel image set PL includes: Based on the image processing parameter vector K, the brightness value s of the image is modified by equalization: , s is the brightness value of the equalized pixel, I is the original pixel brightness value, cdf(I) is the cumulative distribution function of I, and L is the brightness level of the image contained in the image processing parameter vector K; Increase or decrease the overall brightness of the image based on the image processing parameter vector K: I'(x,y)=I(x,y)+Kl, I'(x,y) is the adjusted pixel value, I(x,y) is the original pixel value, Kl is the brightness adjustment parameter contained in the image processing parameter vector K; Based on the image processing parameter vector K, change the contrast of the image: , μ is the average brightness value of the image, Kz is the contrast enhancement factor contained in the image processing parameter vector K; Based on the image processing parameter vector K, the image is subjected to random noise filtering: , , G(m,q) is the filter kernel function, m,q are the filter offset parameter values, and σ is the standard deviation of the images in the carousel image set; The adjustment of the size and arrangement of the images according to different screen sizes to match the display effects of the carousel images on different devices includes: Determine the scaling factor ScaleFactor: , Represents the base width value, and ViewportWidth represents the width value of the carousel image window; Calculate the adaptive width value of the carousel image according to the scaling factor ScaleFactor and adaptive height values : , , Indicates the original base width of the carousel image. Indicates the original base height of the carousel image.

2. The method according to claim 1, characterized in that The method further comprises: Design a basic HTML structure, including a container element to wrap all images, determine the HTML tags for each image, and ensure that they can be displayed correctly on different devices and screen sizes.

3. The method according to claim 2, characterized in that The method further comprises: Write JavaScript code to control the logic of the image carousel, including automatic playback, pause, and manual switching of images. Use JavaScript to handle user interaction events and implement manual switching of images.

4. The method according to claim 3, characterized in that The method further comprises: The image is only loaded when it enters the viewport, reducing initial loading time and resource consumption; Use Polyfill and browser prefixes to ensure compatibility of CSS3 and HTML5 features in different browsers; Add alternative text for each image to improve search engine crawlability and accessibility, and ensure that the image carousel functionality still works when JavaScript is disabled.

5. An image carousel display device based on circular arrangement, characterized in that: include: A setting module, after acquiring n original image sets P to be displayed in a carousel, sets an image processing parameter vector K for the original image set P, so as to perform image preprocessing on the original image set P based on the image processing parameter vector K to obtain a carousel image set PL; The control module designs a layout control vector Ks=[CS, IS, TI, AD, RD] for the carousel image set PL, where CS represents the selector of the container containing all images, IS represents the image selector array, each element in the image selector array is a string representing the selector of a single image, TI equals n, representing the total number of images participating in the carousel, AD represents the duration of the transition animation, and RD represents the carousel direction; The layout module applies the transform attribute to each image in the carousel image set PL, calculates the x and y coordinates based on the image index and the radius of the circle so that the images are arranged on the circumference, initializes rotate to the angle calculated based on the image index so that the images are arranged around the center point, and adds the features in the design layout control vector to each image; The matching module adjusts the size and arrangement of images according to different screen sizes, matches the display effect of the carousel images on different devices, and dynamically adjusts the radius of the circular arrangement and the spacing between images to adapt to different viewport sizes; The performing image preprocessing on the original image set P based on the image processing parameter vector K to obtain the carousel image set PL includes: Based on the image processing parameter vector K, the brightness value s of the image is modified by equalization: , s is the brightness value of the equalized pixel, I is the original pixel brightness value, cdf(I) is the cumulative distribution function of I, and L is the brightness level of the image contained in the image processing parameter vector K; Increase or decrease the overall brightness of the image based on the image processing parameter vector K: I'(x,y)=I(x,y)+Kl, I'(x,y) is the adjusted pixel value, I(x,y) is the original pixel value, Kl is the brightness adjustment parameter contained in the image processing parameter vector K; Based on the image processing parameter vector K, change the contrast of the image: , μ is the average brightness value of the image, Kz is the contrast enhancement factor contained in the image processing parameter vector K; Based on the image processing parameter vector K, the image is subjected to random noise filtering: , , G(m,q) is the filter kernel function, m,q are the filter offset parameter values, and σ is the standard deviation of the images in the carousel image set; The adjustment of the size and arrangement of the images according to different screen sizes to match the display effects of the carousel images on different devices includes: Determine the scaling factor ScaleFactor: , Represents the base width value, and ViewportWidth represents the width value of the carousel image window; Calculate the adaptive width value of the carousel image according to the scaling factor ScaleFactor and adaptive height values : , , Indicates the original base width of the carousel image. Indicates the original base height of the carousel image.

6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image carousel display method based on circular arrangement as described in any one of claims 1 to 4.