application on images with various sizes
Opened this issue · 2 comments
Thank you for this nice work.
However, I hope your nice work could be able to apply on images with various sizes (at least not square). Sadly, I have no elegant idea about how to implement it based on your work.
Fixing applications on images with various sizes typically involves adapting the application to handle different image dimensions and aspect ratios. Here are some general steps to address this issue:
• Responsive Design: Ensure that the user interface (UI) of your application is designed to be responsive. This means that UI elements (buttons, text, images) can adapt to different screen sizes and orientations. Use layout tools like ConstraintLayout (for Android) or Auto Layout (for iOS) to achieve this.
• Scaling: Use scaling techniques to resize images dynamically based on the screen size. This can prevent images from appearing too small or too large on different devices. Make use of libraries or functions in your chosen development platform to scale images proportionally.
• Aspect Ratio Consideration: Be mindful of the aspect ratios of your images. If you're displaying images in a fixed-size container, you may need to crop or letterbox images to fit the container while maintaining the correct aspect ratio. Alternatively, use dynamic layouts that adjust to the image's aspect ratio.
• Adaptive Layouts: Consider using adaptive layouts or design patterns like flexbox (for web) or stack views (for iOS) that can automatically adjust the positioning and sizing of UI elements based on the available screen space.
• Device Testing: Test your application on various devices and screen sizes to identify issues. Emulators and simulators can help, but real device testing is crucial to ensure a consistent user experience.
• Multiple Image Versions: Create multiple versions of images with different resolutions (e.g., @1x, @2x, @3x for iOS or ldpi, mdpi, hdpi, xhdpi, xxhdpi for Android) and load the appropriate version based on the device's screen density. This ensures that images look sharp on high-resolution screens and load quickly on lower-end devices.
• Dynamic Content Loading: If your app fetches images from a server, ensure that the server can provide images in different resolutions or sizes based on the device's capabilities. Use responsive image loading techniques to request the appropriate image size.
• User Experience: Pay attention to the user experience. Ensure that the app remains visually appealing and functional regardless of the device used. Test for usability and readability on various screen sizes.
• Media Queries (Web): If you're developing a web application, use CSS media queries to apply different styles or layouts based on the screen size and resolution.
Documentation: Document the guidelines and best practices for handling various image sizes and resolutions in your application's development documentation. This will help your team maintain consistency in handling images.
By following these steps and utilizing platform-specific tools and libraries, you can create an application that adapts gracefully to images with various sizes, providing a consistent and user-friendly experience across different devices.
Thank you for this nice work.
However, I hope your nice work could be able to apply on images with various sizes (at least not square). Sadly, I have no elegant idea about how to implement it based on your work.
Thank you for your suggestion. In fact, we have made a basic implementation in support of various sizes. We just include the resizing process within the attack. You can try run following code, in which the "non_resize" option will support non-square image:
python mist_v3.py -img test/sample_random_size.png --output_name misted_sample --mask --non_resize --mask_path test/processed_mask.png
However, our implementation is not a very elegant idea to support various sizes. If you have any further idea, feel free to contact us. Thank you.