There might be a better solution that this but... the shapes are saved on the XML of the Tableau Workbook, these 2 articles talk more about this:
If you unpackage the TWBX, you will see a TWB file that you can open in a text editor. You can then search for the <shapes> tag and you could remove anything within that tag. Please keep in mind that manually modifying the XML might break your worbook and Tableau support won't be able to help with that, always save a backup copy if you are going to modify the XML directly.
Hope that helps!
Another tip to try would be to create a shape within the viz and reset it back to default shapes, then undo the shape and save the viz.
I have tried like what you suggested.
When I removed the codes within the <shapes> tag, it does reduce the size of .twb.
However, every time I save it (whether to format .twbx or .twb), the size still >300mb.
I am not sure why.
Could you elaborate more about it?
I am not really understand about what you said.
My suggestion is to try to 'flush' any custom shapes out of Tableau by replacing them with stock shapes. By saving the viz after replacing the custom shapes with stock shapes this should reset the .twbx file size.
However, I am not convinced that the size of the viz is related to the shapes, I think it is something else. Appreciate if you could upload a sample so we can investigate.
I haven't tested this but I have a theory on what may be happening... When you save the workbook Tableau grabs the custom shapes from your local computer (Documents\My Tableau Repository\Shapes) and adds them to the XML. So, even if initially you are able to reduce the size of the XML by erasing anything within the <shapes> tag, after you open in Tableau and save again the shapes are added back.
In thinking how to validate this, I would move any custom shapes out of the Documents\My Tableau Repository\Shapes folder (keep them on another folder so you don't lose them) and restart Tableau. Once you save, does the size of the TWB or TWBX change? If if doesn't, can you first erase the content within the <shapes> tag and then save (while keeping the custom shapes out of My Tableau Repository)?
Hope that helps! Wish I could think of an easier way but this is usually not a problem with smaller images or small number of images used for custom shapes.
I found the solution for this issue.
These are the steps that I did, and it works:
1. Open the original .twbx file (300mb).
2. Select on any images from the dashboard, then go to the sheet.
3. Double click on the custom shape (the image).
4. Hit reset on custom shape's pop-up dialog.
4. Click OK then try save the packaged workbook.
5. The size should be reduced now. (I got less than 10mb on the file).
Anyway, thanks guys for the suggestions.