FPS/Quality Slider or changer

So it makes it smaller. I want it change the resolution like the picture

Those are talking about monitor/display screen resolutions, the source image is the same resolution and just scaled smaller when viewed on a smaller resolution display. That has nothing to do with how most 2D games are rendered, and won’t really do anything for you in this case.

If you really want to try, you can either start at a higher resolution for your assets and game resolution, and hope it scales down appropriately (note that you will not be able to use 4k images, most browsers hard cap asset resolution at 2048x2048 when displaying more than one image), or you will need to draw different images for each size you want.